/* Autoclipper admin — visual system.
 *
 * Ported from the approved design prototype (the admin redesign handoff, no
 * longer kept in the tree). Every rule is scoped under
 * `.acp` because this file loads alongside styles.css, which keeps the live
 * and tasks workspaces on their own look: unscoped, the eleven shared class
 * names (.panel, .button, .progress, .brand, .table-wrap, ...) would restyle
 * screens this redesign does not cover.
 *
 * Generated once and then maintained by hand; the generator lived in the
 * migration session and is not part of the build.
 */

/* Inter, self-hosted. `default-src 'self'` in the CSP (api.go) covers font-src,
 * so a CDN or Google Fonts link would simply be blocked. Cyrillic ships first
 * because the whole interface is Russian; latin follows for ids and logins.
 * Licence: SIL OFL 1.1, see assets/fonts/LICENSE-Inter.txt.
 * The urls are relative so that under /s/<version>/admin.css the fonts come
 * from the same version and are cached with it (api.go, serveVersioned). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/inter-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/inter-cyrillic-500-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/inter-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/inter-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/inter-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/inter-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --canvas: #090b10;
  --shell: #0c0f15;
  --surface: #11151d;
  --surface-raised: #171c26;
  --surface-hover: #1d2430;
  --surface-selected: rgba(118, 228, 181, 0.08);
  --line: #293142;
  --line-strong: #3a445a;
  --text: #f2f5f8;
  --text-secondary: #98a4b7;
  --text-subtle: #6f7a8c;
  --text-disabled: #596477;
  --accent: #76e4b5;
  --accent-hover: #8aecbf;
  --accent-pressed: #5fcf9f;
  --accent-ink: #07150f;
  --success: #61d3a0;
  --info: #68b5ff;
  --warning: #ffc86b;
  --danger: #ff7d8c;
  --success-bg: rgba(97, 211, 160, 0.1);
  --info-bg: rgba(104, 181, 255, 0.1);
  --warning-bg: rgba(255, 200, 107, 0.1);
  --danger-bg: rgba(255, 125, 140, 0.1);
  --focus-ring: rgba(118, 228, 181, 0.55);
  --overlay: rgba(5, 7, 11, 0.76);
  --sidebar-width: 220px;
}
.acp {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f2f5f8;
  background: #090b10;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
.acp, .acp *, .acp *::before, .acp *::after {
  box-sizing: border-box;
}
.acp button,
.acp input,
.acp textarea,
.acp select {
  font: inherit;
}
.acp button,
.acp a,
.acp input,
.acp textarea,
.acp select,
.acp summary {
  outline: none;
}
.acp button:focus-visible,
.acp a:focus-visible,
.acp input:focus-visible,
.acp textarea:focus-visible,
.acp select:focus-visible,
.acp summary:focus-visible {
  box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--focus-ring);
}
.acp button,
.acp a {
  -webkit-tap-highlight-color: transparent;
}
.acp button:disabled {
  cursor: not-allowed;
}
.acp img {
  display: block;
  max-width: 100%;
}
.acp h1,
.acp h2,
.acp h3,
.acp p {
  margin: 0;
}
.acp h1,
.acp h2,
.acp h3 {
  letter-spacing: -0.02em;
}
.acp ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.acp ::-webkit-scrollbar-track {
  background: transparent;
}
.acp ::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #344054;
  background-clip: padding-box;
}
.acp ::-webkit-scrollbar-thumb:hover {
  background: #47556d;
  background-clip: padding-box;
}
.acp .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.acp .mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.acp .text-subtle {
  color: var(--text-subtle);
}
.acp .text-success {
  color: var(--success) !important;
}
.acp .text-warning {
  color: var(--warning) !important;
}
.acp .text-danger {
  color: var(--danger) !important;
}
.acp .body-copy {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}
.acp .app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: var(--canvas);
}
.acp .app-shell.has-collapsed-sidebar {
  --sidebar-width: 72px;
}
.acp .sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  min-width: 0;
  height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--shell);
}
.acp .sidebar__brand-row {
  display: flex;
  height: 72px;
  flex: 0 0 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
}
.acp .brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.acp .brand__mark {
  flex: 0 0 auto;
  color: var(--accent);
}
.acp .brand__name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-overflow: clip;
}
.acp .sidebar__nav {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 26px;
  overflow-y: auto;
  padding: 8px 10px 20px;
}
.acp .sidebar__primary,
.acp .nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.acp .nav-group__label {
  margin: 5px 12px 7px;
  overflow: hidden;
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.acp .nav-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 42px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  transition: color 120ms ease, background 120ms ease;
}
.acp .nav-item > span:not(.nav-count) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .nav-item:hover {
  background: var(--surface-raised);
  color: var(--text);
}
.acp .nav-item.is-active {
  background: var(--surface-selected);
  color: var(--text);
}
.acp .nav-item.is-active::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -10px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
  content: "";
}
.acp .nav-item.is-active svg {
  color: var(--accent);
}
.acp .nav-count {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.acp .sidebar__footer {
  display: flex;
  min-height: 74px;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 10px 10px;
  border-top: 1px solid var(--line);
}
.acp .profile-button {
  display: grid;
  min-width: 0;
  flex: 1;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.acp .profile-button:hover {
  background: var(--surface-raised);
}
.acp .profile-button__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.acp .profile-button__copy strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .profile-button__copy small {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid #354155;
  border-radius: 50%;
  background: #202938;
  color: #dce4ef;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.acp .avatar--admin {
  border-color: #34654f;
  background: #1e4737;
  color: #ddf8eb;
}
.acp .sidebar__collapse {
  flex: 0 0 auto;
}
.acp .sidebar__mobile-close,
.acp .mobile-topbar,
.acp .sidebar-scrim {
  display: none;
}
.acp .sidebar .sidebar__mobile-close {
  display: none;
}
.acp .has-collapsed-sidebar .sidebar__brand-row {
  justify-content: center;
  padding: 0;
}
.acp .has-collapsed-sidebar .brand__name,
.acp .has-collapsed-sidebar .nav-item > span:not(.nav-count),
.acp .has-collapsed-sidebar .nav-group__label,
.acp .has-collapsed-sidebar .profile-button__copy,
.acp .has-collapsed-sidebar .profile-button > svg,
.acp .has-collapsed-sidebar .nav-count,
.acp .has-collapsed-sidebar .sidebar__collapse {
  display: none;
}
.acp .has-collapsed-sidebar .nav-item {
  display: flex;
  justify-content: center;
  padding: 0;
}
.acp .has-collapsed-sidebar .nav-item.is-active::before {
  left: -10px;
}
.acp .has-collapsed-sidebar .profile-button {
  display: flex;
  justify-content: center;
  padding: 0;
}
.acp .app-main {
  min-width: 0;
  height: 100dvh;
  overflow: hidden;
}
.acp .page {
  min-width: 0;
  height: 100%;
  background: var(--canvas);
}
.acp .page--standard {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px 26px 32px;
}
.acp .page--workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  padding: 22px 24px 0;
}
.acp .page-header {
  display: flex;
  min-height: 62px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
}
.acp .page-header__copy {
  min-width: 0;
}
.acp .page-header h1 {
  color: var(--text);
  font-size: 27px;
  font-weight: 700;
  line-height: 34px;
}
.acp .page-header p {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
}
.acp .page-header__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}
.acp .eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.acp .page-toolbar,
.acp .montage-toolbar {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.acp .page--standard .page-toolbar {
  margin-bottom: 18px;
}
.acp .tabs {
  display: flex;
  min-width: 0;
  align-self: stretch;
  gap: 6px;
}
.acp .tab {
  position: relative;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.acp .tab:hover {
  color: var(--text);
}
.acp .tab.is-active {
  color: var(--text);
  font-weight: 600;
}
.acp .tab.is-active::after {
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  content: "";
}
.acp .tab__count {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.acp .toolbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}
.acp .button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
  white-space: nowrap;
}
.acp .button:active:not(:disabled) {
  transform: translateY(1px);
}
.acp .button--sm {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}
.acp .button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.acp .button--primary:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}
.acp .button--primary:active:not(:disabled) {
  border-color: var(--accent-pressed);
  background: var(--accent-pressed);
}
.acp .button--secondary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
}
.acp .button--secondary:hover:not(:disabled) {
  border-color: #4d5b74;
  background: var(--surface-raised);
}
.acp .button--soft {
  border-color: rgba(118, 228, 181, 0.24);
  background: var(--surface-selected);
  color: var(--accent);
}
.acp .button--soft:hover:not(:disabled) {
  background: rgba(118, 228, 181, 0.14);
}
.acp .button--ghost,
.acp .button--danger-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
}
.acp .button--ghost:hover:not(:disabled) {
  background: var(--surface-raised);
  color: var(--text);
}
.acp .button--danger-ghost {
  color: var(--danger);
}
.acp .button--danger-ghost:hover:not(:disabled) {
  background: var(--danger-bg);
}
.acp .button--danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #24070c;
}
.acp .button--danger:hover:not(:disabled) {
  background: #ff93a0;
}
.acp .button:disabled {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text-disabled);
  opacity: 0.78;
}
.acp .icon-button {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.acp .icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
}
.acp .search-field {
  display: grid;
  width: min(290px, 30vw);
  min-width: 210px;
  height: 38px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-secondary);
}
.acp .search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(118, 228, 181, 0.12);
}
.acp .search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}
.acp .search-field input::placeholder {
  color: var(--text-subtle);
}
.acp .search-field button {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
}
.acp .field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}
.acp .field__label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}
.acp .field__hint {
  color: var(--text-subtle);
  font-size: 11px;
  line-height: 16px;
}
.acp .field input,
.acp .field textarea,
.acp .field select,
.acp .copy-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.acp .field input,
.acp .field select,
.acp .copy-field input {
  height: 38px;
  padding: 0 11px;
}
.acp .field textarea {
  min-height: 86px;
  padding: 10px 11px;
  line-height: 1.5;
  resize: vertical;
}
.acp .field input::placeholder,
.acp .field textarea::placeholder {
  color: var(--text-subtle);
}
.acp .field input:hover,
.acp .field textarea:hover,
.acp .field select:hover,
.acp .copy-field input:hover {
  border-color: var(--line-strong);
}
.acp .field input:focus,
.acp .field textarea:focus,
.acp .field select:focus,
.acp .copy-field input:focus {
  border-color: var(--accent);
}
.acp .field--compact {
  gap: 0;
}
.acp .select-wrap {
  position: relative;
  display: flex;
  min-width: 0;
}
.acp .select-wrap select {
  min-width: 148px;
  appearance: none;
  padding-right: 34px;
}
.acp .select-wrap > svg {
  position: absolute;
  top: 50%;
  right: 10px;
  pointer-events: none;
  transform: translateY(-50%);
  color: var(--text-secondary);
}
.acp .field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.acp .form-stack,
.acp .drawer-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.acp .status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(152, 164, 183, 0.07);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}
.acp .status--success {
  border-color: rgba(97, 211, 160, 0.28);
  background: var(--success-bg);
  color: var(--success);
}
.acp .status--info {
  border-color: rgba(104, 181, 255, 0.28);
  background: var(--info-bg);
  color: var(--info);
}
.acp .status--warning {
  border-color: rgba(255, 200, 107, 0.28);
  background: var(--warning-bg);
  color: var(--warning);
}
.acp .status--danger {
  border-color: rgba(255, 125, 140, 0.28);
  background: var(--danger-bg);
  color: var(--danger);
}
.acp .status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.acp .progress {
  position: relative;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #273142;
}
.acp .progress__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}
.acp .progress__bar--success {
  background: var(--success);
}
.acp .progress__bar--warning {
  background: var(--warning);
}
.acp .panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.acp .panel__header {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.acp .panel__header h2 {
  font-size: 15px;
  font-weight: 650;
  line-height: 21px;
}
.acp .panel__header p {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 17px;
}
.acp .panel__actions {
  display: flex;
  gap: 8px;
}
.acp .stats-grid {
  display: grid;
  gap: 10px;
}
.acp .stats-grid--vertical {
  grid-template-columns: 1fr;
}
.acp .stats-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.acp .stat {
  display: flex;
  min-width: 0;
  min-height: 92px;
  flex-direction: column;
  justify-content: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.acp .stat strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.acp .stat > span {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}
.acp .stat small {
  margin-top: 6px;
  color: var(--text-subtle);
  font-size: 11px;
}
.acp .stat--accent strong {
  color: var(--accent);
}
.acp .stat--success strong {
  color: var(--success);
}
.acp .stat--info strong {
  color: var(--info);
}
.acp .stat--danger strong {
  color: var(--danger);
}
.acp .notice {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid rgba(104, 181, 255, 0.22);
  border-radius: 8px;
  background: var(--info-bg);
  color: var(--info);
  font-size: 12px;
}
.acp .notice > div {
  min-width: 0;
}
.acp .notice strong {
  color: inherit;
  font-size: 12px;
  font-weight: 600;
}
.acp .notice p {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 16px;
}
.acp .notice--success {
  border-color: rgba(97, 211, 160, 0.22);
  background: var(--success-bg);
  color: var(--success);
}
.acp .notice--warning {
  border-color: rgba(255, 200, 107, 0.22);
  background: var(--warning-bg);
  color: var(--warning);
}
.acp .notice--danger {
  border-color: rgba(255, 125, 140, 0.22);
  background: var(--danger-bg);
  color: var(--danger);
}
.acp .check-row,
.acp .radio-row {
  position: relative;
  display: grid;
  min-height: 50px;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
.acp .check-row:hover,
.acp .radio-row:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
}
.acp .check-row:has(input:checked),
.acp .radio-row:has(input:checked) {
  border-color: rgba(118, 228, 181, 0.42);
  background: var(--surface-selected);
}
.acp .check-row input,
.acp .radio-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.acp .check-row__box,
.acp .radio-row__circle {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--canvas);
  color: transparent;
}
.acp .check-row input:checked + .check-row__box {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.acp .radio-row__circle {
  border-radius: 50%;
}
.acp .radio-row input:checked + .radio-row__circle {
  border: 5px solid var(--accent);
  background: var(--canvas);
}
.acp .check-row__copy,
.acp .radio-row__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.acp .check-row__copy strong,
.acp .radio-row__copy strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 17px;
}
.acp .check-row__copy span,
.acp .radio-row__copy span {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 15px;
}
.acp .choice-list,
.acp .radio-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.acp .choice-list--two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.acp .toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}
.acp .toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.acp .toggle__track {
  display: flex;
  width: 32px;
  height: 18px;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #242c39;
  transition: background 120ms ease, border-color 120ms ease;
}
.acp .toggle__track span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: transform 120ms ease, background 120ms ease;
}
.acp .toggle input:checked + .toggle__track {
  border-color: var(--accent);
  background: rgba(118, 228, 181, 0.18);
}
.acp .toggle input:checked + .toggle__track span {
  background: var(--accent);
  transform: translateX(14px);
}
.acp .key-value {
  display: flex;
  margin: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.acp .key-value > div {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
}
.acp .key-value > div:last-child {
  border-bottom: 0;
}
.acp .key-value dt {
  color: var(--text-secondary);
  font-size: 11px;
}
.acp .key-value dd {
  margin: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  text-align: right;
}
.acp .inline-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}
.acp .inline-link:hover {
  color: var(--accent-hover);
}
.acp .table-wrap {
  width: 100%;
  max-width: 100%;
  contain: inline-size paint;
  overflow: auto;
}
.acp .data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.acp .data-table th {
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #0f131b;
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.acp .data-table td {
  min-height: 58px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-secondary);
  vertical-align: middle;
}
.acp .data-table tbody tr:last-child td {
  border-bottom: 0;
}
.acp .data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}
.acp .data-table tr.is-selected td {
  background: var(--surface-selected);
}
.acp .data-table td > strong,
.acp .data-table td > small {
  display: block;
}
.acp .data-table td > strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.acp .data-table td > small {
  margin-top: 3px;
  color: var(--text-subtle);
  font-size: 10px;
}
.acp .table-panel {
  min-height: 0;
}
.acp .table-progress {
  display: grid;
  min-width: 110px;
  grid-template-columns: minmax(60px, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.acp .table-progress--wide {
  min-width: 135px;
}
.acp .person-cell,
.acp .channel-cell {
  display: flex;
  min-width: 160px;
  align-items: center;
  gap: 9px;
}
.acp .person-cell > div,
.acp .channel-cell > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.acp .person-cell strong,
.acp .channel-cell strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .person-cell small,
.acp .channel-cell small {
  color: var(--text-subtle);
  font-size: 10px;
}
.acp .channel-avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid #3b495f;
  border-radius: 7px;
  background: #202938;
  color: #dce4ef;
  font-size: 10px;
  font-weight: 700;
}
.acp .disclosure {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.acp .disclosure summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  list-style: none;
}
.acp .disclosure summary::-webkit-details-marker {
  display: none;
}
.acp .disclosure summary svg {
  transition: transform 180ms ease;
}
.acp .disclosure[open] summary svg {
  transform: rotate(90deg);
}
.acp .disclosure__body {
  padding: 0 12px 12px;
}
.acp .detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.acp .overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: var(--overlay);
}
.acp .overlay--center {
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.acp .drawer {
  display: grid;
  width: min(var(--drawer-width), calc(100vw - 24px));
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-left: 1px solid var(--line-strong);
  background: var(--shell);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38);
  animation: acp-drawer-in 180ms ease both;
}
@keyframes acp-drawer-in {
  from { transform: translateX(18px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.acp .drawer__header,
.acp .modal__header {
  display: flex;
  min-height: 76px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.acp .drawer__header h2,
.acp .modal__header h2 {
  font-size: 19px;
  font-weight: 700;
  line-height: 25px;
}
.acp .drawer__header p,
.acp .modal__header p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 17px;
}
.acp .drawer__body,
.acp .modal__body {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px;
}
.acp .drawer__footer,
.acp .modal__footer {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: #0e1219;
}
.acp .drawer-total {
  display: flex;
  margin-right: auto;
  flex-direction: column;
  gap: 2px;
}
.acp .drawer-total span {
  color: var(--text-secondary);
  font-size: 10px;
}
.acp .drawer-total strong {
  font-size: 13px;
}
.acp .modal {
  display: grid;
  width: min(520px, calc(100vw - 32px));
  max-height: min(850px, calc(100dvh - 40px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--shell);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38);
}
.acp .modal--lg {
  width: min(760px, calc(100vw - 32px));
}
.acp .modal--sm {
  width: min(420px, calc(100vw - 32px));
}
.acp .toast {
  position: fixed;
  z-index: 140;
  right: 24px;
  bottom: 24px;
  display: grid;
  max-width: 440px;
  min-height: 48px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(97, 211, 160, 0.3);
  border-radius: 9px;
  background: #15221d;
  color: var(--success);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  font-size: 12px;
}
.acp .toast--info {
  border-color: rgba(104, 181, 255, 0.3);
  background: #121c27;
  color: var(--info);
}
.acp .toast--danger {
  border-color: rgba(255, 125, 140, 0.3);
  background: #25151a;
  color: var(--danger);
}
.acp .toast button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: currentColor;
  cursor: pointer;
}
.acp .form-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.acp .form-section--flat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.acp .form-section__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.acp .form-section__heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
}
.acp .form-section h3 {
  font-size: 13px;
  font-weight: 650;
}
.acp .step-number {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}
@media (prefers-reduced-motion: reduce) {
  .acp *,
.acp *::before,
.acp *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
/* Разметка: одна запись, полоса по ней и два действия над участком */
.acp .research-layout--markup {
  grid-template-columns: 300px minmax(0, 1fr);
}
.acp .markup-channel {
  display: grid;
  gap: 4px;
  padding-bottom: 8px;
}
.acp .markup-channel__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
}
.acp .markup-channel__head strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}
.acp .markup-channel__head small {
  margin-left: auto;
  color: var(--text-subtle);
  font-size: 10px;
}
.acp .markup-strip {
  display: grid;
  gap: 6px;
  margin: 12px 0 4px;
}
.acp .markup-strip__track {
  display: flex;
  overflow: hidden;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.acp .markup-strip__part {
  min-width: 1px;
  border-right: 1px solid rgba(0, 0, 0, 0.28);
}
.acp .markup-strip__part:last-child {
  border-right: 0;
}
.acp .markup-strip__part--released {
  background: var(--info);
}
.acp .markup-strip__part--ready {
  background: var(--accent);
}
.acp .markup-strip__part--running {
  background: var(--warning);
}
.acp .markup-strip__part--partial {
  background: var(--warning-bg);
}
.acp .markup-strip__part--idle {
  background: var(--surface-hover);
}
.acp .markup-strip__scale {
  display: flex;
  justify-content: space-between;
  color: var(--text-subtle);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.acp .markup-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  color: var(--text-secondary);
  font-size: 10px;
  list-style: none;
}
.acp .markup-legend li {
  display: flex;
  align-items: center;
  gap: 5px;
}
.acp .markup-legend__dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}
.acp .markup-legend__dot--released {
  background: var(--info);
}
.acp .markup-legend__dot--ready {
  background: var(--accent);
}
.acp .markup-legend__dot--running {
  background: var(--warning);
}
.acp .markup-legend__dot--partial {
  background: var(--warning-bg);
}
.acp .markup-legend__dot--idle {
  background: var(--surface-hover);
}
.acp .coverage-list,
.acp .release-list,
.acp .run-list,
.acp .task-list {
  display: grid;
  gap: 8px;
}

/* Прогон: колонки фиксированы, поэтому строка не пляшет от длины причины,
   а причина — одна строка с многоточием, а не абзац из тела ответа провайдера. */
.acp .run-row {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.acp .run-row__what {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.acp .run-row__what strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .run-row__what small {
  color: var(--text-subtle);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.acp .run-row__why {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .run-row__act {
  display: flex;
  gap: 4px;
  justify-self: end;
}
.acp .run-fold {
  margin-top: 8px;
}
.acp .run-fold > summary {
  padding: 7px 2px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11px;
}
.acp .run-fold > summary:hover {
  color: var(--text);
}
.acp .run-fold[open] > summary {
  margin-bottom: 8px;
}
.acp .coverage-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
}
.acp .coverage-row > div,
.acp .release-row > div,
.acp .task-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.acp .coverage-row strong,
.acp .release-row strong,
.acp .task-row strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}
.acp .coverage-row small,
.acp .release-row small,
.acp .task-row small {
  color: var(--text-subtle);
  font-size: 10px;
}
.acp .release-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
/* Задание: имя участка, полоса готовности, кнопка. Три колонки, чтобы полосы
   выстроились в столбик и разница между людьми читалась сразу. */
.acp .task-row {
  display: grid;
  grid-template-columns: minmax(0, 210px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.acp .task-row--retired {
  border-style: dashed;
  background: transparent;
}
.acp .task-row__what {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.acp .task-group {
  display: grid;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.acp .task-group:last-child {
  border-bottom: 0;
}
.acp .task-group__head {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}
.acp .task-group__head::-webkit-details-marker {
  display: none;
}
.acp .task-group__head::after {
  margin-left: 6px;
  color: var(--text-subtle);
  content: "▸";
  font-size: 10px;
}
.acp .task-group[open] > .task-group__head::after {
  content: "▾";
}
.acp .task-group__head small {
  margin-left: auto;
  color: var(--text-subtle);
  font-size: 10px;
}
.acp .span-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* Итог действия в drawer'е. Свой класс, а не `.assignment-preview`: тот —
   двухколоночная сетка под иконку и текст, и одинокий блок попадал в колонку
   шириной 22 px, где каждое слово переносилось на свою строку. */
.acp .markup-preview {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid rgba(118, 228, 181, 0.22);
  border-radius: 8px;
  background: var(--surface-selected);
}
.acp .markup-preview > div {
  display: grid;
  gap: 3px;
}
.acp .markup-preview strong {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.acp .markup-preview span {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 16px;
}

/* Assignments */
.acp .assignment-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.acp .compact-panel {
  padding: 14px;
}
.acp .compact-panel .panel__header {
  min-height: 0;
  padding: 0 0 10px;
  border-bottom: 0;
}
.acp .compact-panel .body-copy {
  margin-bottom: 12px;
}
.acp .assignment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.acp .drawer-context {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.acp .drawer-context > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.acp .drawer-context strong {
  font-size: 12px;
}
.acp .drawer-context span {
  color: var(--text-secondary);
  font-size: 11px;
}
.acp .choice-list--people {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 3px;
}
.acp .assignment-preview {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(118, 228, 181, 0.22);
  border-radius: 8px;
  background: var(--surface-selected);
  color: var(--accent);
}
.acp .assignment-preview > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.acp .assignment-preview strong {
  color: var(--text);
  font-size: 12px;
}
.acp .assignment-preview span {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 16px;
}
/* Research */
.acp .research-layout {
  display: grid;
  min-height: 650px;
  grid-template-columns: minmax(300px, 0.8fr) minmax(440px, 1.2fr);
  grid-template-rows: minmax(460px, auto) auto;
  gap: 14px;
}
.acp .research-list-panel,
.acp .research-detail-panel,
.acp .research-jobs-panel {
  min-height: 0;
}
.acp .research-list-panel .panel__header {
  min-height: 54px;
}
.acp .record-list {
  display: flex;
  max-height: 570px;
  flex-direction: column;
  overflow-y: auto;
}
.acp .record-row {
  display: grid;
  min-height: 82px;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.acp .record-row:last-child {
  border-bottom: 0;
}
.acp .record-row:hover {
  background: rgba(255, 255, 255, 0.018);
}
.acp .record-row.is-selected {
  background: var(--surface-selected);
  box-shadow: inset 3px 0 0 var(--accent);
}
.acp .record-row img {
  width: 96px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
}
/* The rows on «Записи» (research.js) and «Разметка» (assign.js) carry no
   picture, and the 96 px track above is the picture's: the copy fell into it and
   the status badge stretched across the wide one. `:has` rather than a modifier
   class: assign.js is not this section's file, and the narrow-width rule in the
   1250 px media query (`.acp .record-row`, 74 px track) comes later in the file
   with the same specificity as a modifier would have. `:not(:has(> img))` counts
   the `img`, so this wins at every width without depending on order. */
.acp .record-row:not(:has(> img)) {
  grid-template-columns: minmax(0, 1fr) auto;
}
.acp .record-row__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.acp .record-row__copy strong,
.acp .record-row__copy span,
.acp .record-row__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .record-row__copy strong {
  font-size: 12px;
  font-weight: 650;
}
.acp .record-row__copy span {
  color: var(--text-secondary);
  font-size: 11px;
}
.acp .record-row__copy small {
  color: var(--text-subtle);
  font-size: 10px;
}
.acp .research-detail-panel {
  padding: 14px;
}
.acp .record-detail__hero {
  position: relative;
  height: 230px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #05070a;
}
.acp .record-detail__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.acp .record-detail__hero::after {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 11, 0.16);
  content: "";
}
.acp .record-detail__overlay {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(8, 11, 16, 0.74);
  color: var(--text);
  transform: translate(-50%, -50%);
}
.acp .record-detail__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 12px;
}
.acp .record-detail__heading h2 {
  font-size: 16px;
  line-height: 22px;
}
.acp .record-detail__heading p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 11px;
}
.acp .research-detail-panel .key-value,
.acp .research-detail-panel .notice {
  margin-bottom: 12px;
}
.acp .research-jobs-panel {
  grid-column: 1 / -1;
}
.acp .job-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.acp .job-row {
  display: grid;
  min-height: 96px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 10px 12px;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
}
.acp .job-row:last-child {
  border-right: 0;
}
.acp .job-row__main {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 9px;
}
.acp .job-row__main > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.acp .job-row__main strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .job-row__main span {
  color: var(--text-secondary);
  font-size: 10px;
}
.acp .job-state {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--text-subtle);
}
.acp .job-state--success {
  background: var(--success);
}
.acp .job-state--info {
  background: var(--info);
}
.acp .job-state--danger {
  background: var(--danger);
}
.acp .job-row__progress {
  display: grid;
  width: 110px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--info);
  font-size: 10px;
}
.acp .benchmarks-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.acp .benchmark-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.acp .benchmark-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.acp .benchmark-overview .stat {
  min-height: 80px;
  padding: 11px 12px;
}
.acp .benchmark-overview .stat strong {
  font-size: 18px;
}
.acp .upload-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.acp .upload-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Montage */
.acp .montage-toolbar {
  min-width: 0;
}
/* Five stages with their counts beside the search and the filter. The tabs do
   not shrink — `.tabs` is `min-width: 0` with visible overflow, so squeezed it
   drew «Рендеры» under the search (W2: 642/652 at 1366; measured 44 px under it
   at 1280, 79 px with three-digit counts). Nor do they scroll: the page rebuilds
   the toolbar on every repaint, and a scrolled strip would jump back and hide
   the active stage again. What gives first is the search (down to 180 px), then
   the tabs' padding below 1366 px; with no room left the search and the filter
   take a row of their own under the tabs. Above the stacked toolbar only
   (≤ 900 px, where the column layout makes `flex-basis` a height). On the
   stage toolbar's own modifier: `.montage-toolbar` is the core Toolbar's
   default class, worn by «Ассеты», «Стримеры», «Аналитика» and «Публикация». */
@media (min-width: 901px) {
  .acp .montage-toolbar--stages {
    flex-wrap: wrap;
    row-gap: 0;
  }
  .acp .montage-toolbar--stages .tabs {
    flex: 0 0 auto;
  }
  .acp .montage-toolbar--stages .toolbar-actions {
    flex: 1 1 300px;
    justify-content: flex-end;
    /* A row of its own under the tabs keeps off the border, as at ≤ 900 px; on
       the tabs' row 5 + 38 + 5 stays inside the toolbar's 50 with its border. */
    padding-block: 5px;
  }
  .acp .montage-toolbar--stages .search-field {
    min-width: 180px;
  }
}
@media (min-width: 901px) and (max-width: 1365px) {
  .acp .montage-toolbar--stages .tabs {
    gap: 2px;
  }
  .acp .montage-toolbar--stages .tab {
    padding-inline: 7px;
  }
}
.acp .master-detail {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: clamp(365px, 34%, 420px) minmax(0, 1fr);
  gap: 10px;
  padding-top: 10px;
}
.acp .queue-panel,
.acp .inspector,
.acp .template-inspector {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px 9px 0 0;
  background: var(--surface);
}
.acp .queue-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 46px;
}
.acp .queue-panel__scroll {
  min-height: 0;
  overflow-y: auto;
}
.acp .queue-panel__footer {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  border-top: 1px solid var(--line);
  background: #0e1219;
  color: var(--text-subtle);
  font-size: 10px;
}
.acp .pagination {
  display: flex;
  align-items: center;
  gap: 5px;
}
.acp .pagination button,
.acp .pagination b {
  display: inline-flex;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
}
.acp .pagination button {
  cursor: pointer;
}
.acp .pagination button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}
.acp .pagination b {
  background: var(--surface-raised);
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
}
.acp .clip-row {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 82px;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.acp .clip-row:last-child {
  border-bottom: 0;
}
.acp .clip-row:hover {
  background: rgba(255, 255, 255, 0.018);
}
.acp .clip-row.is-selected {
  background: var(--surface-selected);
}
.acp .clip-row.is-selected::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--accent);
  content: "";
}
.acp .clip-row img {
  width: 96px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  background: #07090d;
}
.acp .clip-row__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.acp .clip-row__copy strong,
.acp .clip-row__copy span,
.acp .clip-row__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .clip-row__copy strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.acp .clip-row__copy span {
  color: var(--text-secondary);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.acp .clip-row__copy small {
  color: var(--text-subtle);
  font-size: 10px;
}
.acp .clip-row__state {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.acp .clip-row__state .progress {
  width: 86px;
}
.acp .clip-row__state > small {
  color: var(--text-subtle);
  font-size: 9px;
  white-space: nowrap;
}
/* The person's own rating of the moment (RATE1): a mark on the row, five keys
   on the card. The keys are the analytics switch (`.an-chips`), so only the
   label and the spacing are said here. */
.acp .clip-row__rating {
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.acp .montage-rating {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}
.acp .montage-rating__label {
  color: var(--text-secondary);
  font-size: 12px;
}
.acp .markup-workbench__header .montage-rating {
  margin-left: auto;
}
/* The retention judge's answer on a render's card (JUDGE-SHOW, ModelVerdict):
   read after the person's own rating, so it is quiet — secondary text in a
   plain frame. «Почему» is the model's whole reasoning: it wraps at any width,
   long words included, and is never clipped. */
.acp .montage-model {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 17px;
  overflow-wrap: anywhere;
}
.acp .montage-model__title {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}
.acp .montage-model__score {
  color: var(--text);
}
.acp .montage-model__label {
  margin-top: 4px;
  font-weight: 600;
}
.acp .montage-model__why {
  white-space: pre-line;
}
.acp .montage-model__posted {
  margin-top: 4px;
}
.acp .montage-model--hidden {
  padding: 8px 12px;
  color: var(--text-subtle);
}
/* «Как есть · Сначала лучшие» over a list column: one line, and under the
   title when the column is too narrow for both — stacked, the two keys read
   as a list of their own. Only headers carrying the switch. */
.acp .master-detail > .queue-panel > .panel__header:has(.an-chips) {
  flex-wrap: wrap;
  row-gap: 8px;
}
.acp .master-detail > .queue-panel > .panel__header .an-chips {
  flex-wrap: nowrap;
}
.acp .inspector,
.acp .template-inspector,
.acp .template-editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
/* Without a column template the one column is `auto`, and an auto track is
   never narrower than the min-content of what it holds. Before M1 the header
   did not wrap, and its min-content was the whole unbreakable title (the h2 is
   nowrap) plus the badge row beside it. On the render card (four badges since
   J2b and B2) the column grew wider than the panel, on a phone and on a laptop
   alike: the body followed it, the player centred itself in the wide column,
   and `overflow: hidden` cut off its right half, the last badge and the confirm
   button (M1, 28.10.2026). The header wraps since M1, so its min-content is the
   larger of the two, not their sum — on a wide card still the whole title,
   because there the h2 stays on one line (it wraps in a narrow card,
   «Narrow inspector» below, and in the markup rail at any width, the rail's
   own rule after the shell takeover), and a long clip name alone would widen
   an auto column. The template inspector and editor had the same auto
   column. */
.acp .inspector,
.acp .template-inspector,
.acp .template-editor {
  grid-template-columns: minmax(0, 1fr);
}
/* A size container, so that what is inside lays itself out by the card's width
   and not by the window's. The window does not say how much room the card has:
   the queue column beside it is clamped, and the sidebar opens past the
   `max-width: 1250px` rule, so a wider window can hold a narrower card. Safe only
   because each of the three gets its width from outside — a master-detail
   track, a flex column, the page — and never from its content, which
   `inline-size` containment stops counting. The rules: «Narrow inspector», after
   the review footer below; the template cards come under them for the footer,
   which they share. */
.acp .inspector,
.acp .template-inspector,
.acp .template-editor {
  container: inspector / inline-size;
}
/* The header wraps: the title block and the badges share a row while both fit
   on it, and the badges move under the title when they do not. Flex decides
   that by the title block's width on one line, which is the longer of the title
   and the subtitle, so a long subtitle alone puts the badges on their own row.
   That is accepted: nothing is cut or covered, the header is one row taller.
   The same header carries the montage, publishing and template cards, and their
   subtitles differ: the montage cards and the pool start with the VOD's name,
   the release card with the account (`@handle`) and then the VOD's name, a
   template card gives its id and version (on the «Основные» tab after the
   pattern's description), the template editor the draft's id and a fixed
   phrase, and the markup rail has none. */
.acp .inspector__header {
  display: flex;
  min-height: 66px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  row-gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #0f131b;
}
.acp .inspector__header > div {
  min-width: 0;
}
/* Badges break between one another like words, and a badge longer than the
   row — «музыка: <название трека>» — breaks inside, between its own words. */
.acp .inspector__header > .panel__actions {
  flex-wrap: wrap;
}
.acp .inspector__header > .panel__actions > .status {
  white-space: normal;
}
.acp .inspector__header h2 {
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  line-height: 23px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .inspector__header p {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.acp .inspector__body {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 12px;
}
/* The row wraps here, in the base rule, and not inside a container query: a
   browser without container queries (before Chrome 105, Safari 16, Firefox
   110) applies none of those blocks, and without the wrap its footer squeezed
   the secondary actions under the main button.
   A column in a card of fixed height must not wrap. A wrapping column's
   minimum height is its tallest item, not the sum, so the grid gives its row
   less than the content needs, and the column breaks into a second one beside
   the first, past the card's edge: the markup rail at 960×900 and a narrow
   review card at 960×500 did (T2, Chrome). Those two say `nowrap`: the markup
   rail below, the narrow card in «Narrow inspector». A column in a card that
   grows with its content keeps the wrap, because it has no height to break
   at: the phone footer (the 680 px block near the end of this part of the
   file) on a card of 530 px or more, which the narrow block does not reach. */
.acp .inspector__footer {
  display: flex;
  min-height: 62px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #0e1219;
}
/* A column at every width (the rail's own rules, after the shell takeover). */
.acp .markup-context-rail > .inspector__footer {
  flex-wrap: nowrap;
}
.acp .inspector__footer .button--primary {
  min-width: 180px;
}
.acp .footer-hint {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 15px;
}
.acp .footer-hint svg {
  flex: 0 0 auto;
  color: var(--success);
}
.acp .media-player {
  position: relative;
  flex: 0 0 auto;
  min-height: 230px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #040609;
}
.acp .media-player img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.acp .media-player__controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  height: 38px;
  grid-template-columns: auto auto minmax(70px, 1fr) auto auto auto;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  background: rgba(5, 7, 10, 0.9);
  color: #e7ecf2;
}
.acp .media-player__controls > span {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.acp .media-player__timeline {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
}
.acp .media-player__timeline span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.acp .media-player--portrait {
  width: min(100%, 320px);
  min-height: 0;
  margin-inline: auto;
  aspect-ratio: 9 / 16;
}
.acp .selection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.acp .selection-section {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1219;
}
.acp .selection-section__heading {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.acp .selection-section__heading > div {
  min-width: 0;
}
.acp .selection-section h3 {
  font-size: 13px;
  font-weight: 650;
}
.acp .selection-section p {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 15px;
}
.acp .editor-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
}
.acp .editor-section__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.acp .editor-section__heading h3 {
  font-size: 14px;
}
.acp .editor-section__heading p {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 10px;
}
.acp .save-state {
  color: var(--warning);
  font-size: 10px;
  white-space: nowrap;
}
.acp .save-state--saved {
  color: var(--success);
}
.acp .portrait-composition {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #05070a;
}
.acp .portrait-composition img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.acp .safe-area,
.acp .template-canvas__safe {
  position: absolute;
  z-index: 2;
  inset: 7% 5% 13%;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  pointer-events: none;
}
.acp .region-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.acp .template-range {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.acp .template-range > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 10px;
}
.acp .template-range strong {
  font-weight: 500;
}
.acp .template-range em {
  color: var(--text);
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.acp .template-range input {
  width: 100%;
  accent-color: var(--accent);
}
.acp .character-count {
  align-self: flex-end;
  margin-top: -5px;
  color: var(--text-subtle);
  font-size: 9px;
}
.acp .template-applied {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid rgba(118, 228, 181, 0.22);
  border-radius: 8px;
  background: var(--surface-selected);
  color: var(--accent);
}
.acp .template-applied > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.acp .template-applied strong {
  color: var(--text);
  font-size: 11px;
}
.acp .template-applied span {
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 15px;
}
.acp .transcript-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.acp .transcript-list > div {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.acp .transcript-list span {
  color: var(--text-subtle);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.acp .transcript-list input {
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d1118;
  color: var(--text);
  font-size: 10px;
}
/* The file on the left, what is known about it on the right — the review and
   history cards here and, as their whole body, the pool and release cards of
   publishing. Only the facts column has a floor, because its values are cut off
   below it; the player is sized in percent and gives way. A floor on the player
   as well asked for more than the body has on a laptop screen (M1).

   Whole flex factors on purpose. Factors that sum to less than one take only
   that share of the leftover: with `.95fr` beside a facts column held at its
   floor, a twentieth of the row stayed empty on the right. A card too narrow
   for both columns gets one («Narrow inspector» below). */
.acp .render-review {
  display: grid;
  grid-template-columns: minmax(0, 19fr) minmax(280px, 21fr);
  align-items: start;
  gap: 12px;
}
.acp .render-review__media {
  display: flex;
  min-height: 0;
  justify-content: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080a0f;
}
.acp .render-review__side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
}
.acp .quality-card,
.acp .decision-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1219;
}
.acp .quality-card > h3,
.acp .decision-form > h3 {
  font-size: 13px;
}
.acp .quality-card__heading {
  display: flex;
  align-items: center;
  gap: 9px;
}
.acp .quality-card__heading > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.acp .quality-card__heading h3 {
  font-size: 12px;
}
.acp .quality-card__heading p {
  color: var(--text-secondary);
  font-size: 10px;
}
.acp .quality-icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
}
.acp .quality-icon--warning {
  background: var(--warning-bg);
  color: var(--warning);
}
.acp .review-note {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acp .review-note > span {
  color: var(--text-subtle);
  font-size: 10px;
}
.acp .review-secondary-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}
.acp .decision-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.acp .inspector__footer--review {
  align-items: center;
}
/* Narrow inspector. A card too narrow for two columns lays out as it does on a
   phone (the 680 px block near the end of this part of the file): one column,
   the player centred above the facts, and the footer stacked, every button the
   full width and the main one first. Side by side, the footer let the secondary
   actions shrink under the main button: «Подтвердить» was drawn over
   «Отклонить», a click on the edge of «Отклонить» accepted the clip, and an
   accept cannot be taken back (M1b, 28.10.2026). Half of a 1920 screen is this
   case.

   Where the line is: in two columns the player gets what the facts leave at
   their floor, so as the card narrows the player shrinks to a strip, while one
   column gives it its full width. The line sits just under the laptop-width
   card (the sidebar open, see the container above): that card keeps two
   columns, anything narrower gets one. What is measured is the card's content
   box, which is its body's width; the numbers are in the M1b report. */
@container inspector (width < 530px) {
  .acp .render-review {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Beside the queue the body is a scroll box of fixed height, and the frame's
     `min-height: 0` lets the grid give the frame's row less than the player
     needs. Side by side nothing sits under that row; stacked, the facts were
     drawn over the lower part of the player. */
  .acp .render-review__media {
    min-height: auto;
  }
  .acp .inspector__footer {
    align-items: stretch;
    flex-direction: column-reverse;
    flex-wrap: nowrap;
  }
  /* Children only: the markup rail keeps the music picker and its listen
     button inside its hint (BedPicker, montage.js), and they are not footer
     actions. */
  .acp .inspector__footer > .button,
  .acp .review-secondary-actions > .button {
    width: 100%;
  }
  .acp .review-secondary-actions {
    width: 100%;
    flex-direction: column;
  }
  /* A touch screen never shows the h2's `title` (Inspector, ui.js), and an
     ellipsis on a phone left the rest of a long clip name unreadable. So in a
     narrow card the name wraps — two lines at most, the ellipsis only after the
     second, so that a name the length of a sentence does not push the body
     down. The markup rail is left out: its title wraps whole at every width
     (its rule after the shell takeover) and is a warning that must not be cut. */
  .acp :not(.markup-context-rail) > .inspector__header h2 {
    display: -webkit-box;
    overflow-wrap: anywhere;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}
/* Two columns fit long before the footer of every card does in one row — the
   release card carries a hint and three buttons — so the row wraps (the base
   footer rule). Wrapped, `space-between` puts a button that moved down a row at
   the start; the auto margins keep what it does when nothing wraps — hint at the
   start, the last button at the end — for that button too. They reproduce
   `space-between` only while at most one item stands between the hint and the
   last button, a footer of the form [hint?, X?, main] (X may be a group of
   buttons): the montage and publishing cards (Inspector) and the template
   editor. Everyone else keeps plain `space-between`:
   - the template card: a draft's footer is [secondary actions, hint?,
     «Опубликовать», «Редактировать»], two items between the ends. Without a
     hint the one auto margin stood before «Редактировать», and «Опубликовать»,
     which `space-between` keeps in the middle, was pressed against the
     secondary actions (M1b);
   - the markup rail: its footer is a column at every width, an auto margin
     across a column undoes the stretch, and the rail is this wide when the
     markup tab stacks its columns (its `max-width: 900px` rule);
   - any footer at a window of 680 px or less: the phone rule (the 680 px block
     near the end of this part of the file) makes it a column, and a card that
     wide still matched the query here, so the margins took the full width from
     the hint (M1b). */
@media (min-width: 681px) {
  @container inspector (width >= 530px) {
    .acp :is(.inspector:not(.markup-context-rail), .template-editor) > .inspector__footer > .footer-hint {
      margin-right: auto;
    }
    .acp :is(.inspector:not(.markup-context-rail), .template-editor) > .inspector__footer > :last-child:not(:first-child) {
      margin-left: auto;
    }
  }
}
.acp .render-progress-card {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0e1219;
}
.acp .render-progress-card__top {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.acp .render-progress-card__top > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.acp .render-progress-card__top h3 {
  font-size: 13px;
}
.acp .render-progress-card__top p {
  color: var(--text-secondary);
  font-size: 10px;
}
.acp .render-progress-card__top > strong {
  color: var(--info);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.acp .render-spinner {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--info-bg);
  color: var(--info);
}
.acp .render-spinner svg {
  animation: acp-spin 1.8s linear infinite;
}
@keyframes acp-spin {
  to { transform: rotate(360deg); }
}
.acp .render-stages {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-subtle);
  font-size: 10px;
}
.acp .render-stages span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.acp .render-stages .is-done {
  color: var(--success);
}
.acp .render-stages .is-active {
  color: var(--info);
}
.acp .empty-inspector {
  display: flex;
  min-height: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px 9px 0 0;
  color: var(--success);
}
.acp .empty-inspector h2 {
  color: var(--text);
  font-size: 17px;
}
.acp .empty-inspector p {
  max-width: 360px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}
/* «Рендеры» (UI-render-open). The cells of this table did not wrap: the
   clipper's `th, td { white-space: nowrap }` in styles.css reaches every table
   in the cabinet, and `.acp .data-table td` does not reset it. An error
   sentence, a badge with a track title and a long clip name each stayed on one
   line, the log came out wider than any window (2583 px on the task's fixture,
   at 1920 as at 1280), and «Смотреть», in the last column, sat past a
   horizontal scroll at the foot of the table. Here the cells and the badges
   wrap, and the actions column is pinned to the right edge of the table's box:
   where the table still cannot fit (a phone), the columns between scroll
   under it instead of pushing it out of view. Each rule names `.render-log`,
   so its specificity, not its place in the file, beats the table's base rules. */
.acp .render-log .data-table td {
  white-space: normal;
  overflow-wrap: break-word;
}
/* A track title is a file name as often as not: one word with underscores. */
.acp .render-log .data-table td .status {
  white-space: normal;
  overflow-wrap: anywhere;
}
/* Floors, so that a phone's narrow table scrolls under the pinned column
   rather than breaking «готов» into letters. */
.acp .render-log .data-table td:first-child {
  min-width: 150px;
}
.acp .render-log .data-table td:nth-child(2) {
  min-width: 130px;
}
.acp .render-log .data-table th:last-child,
.acp .render-log .data-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  box-shadow: -10px 0 10px -10px rgba(0, 0, 0, 0.7);
}
/* Opaque, or the columns scrolled under it show through. */
.acp .render-log .data-table td:last-child {
  background: var(--canvas);
}
.acp .render-log .data-table tbody tr:hover td:last-child {
  background: linear-gradient(rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0.015)), var(--canvas);
}
.acp .render-log .render-row__actions > * {
  white-space: nowrap;
}
.acp .render-log tr.render-row {
  cursor: pointer;
}
.acp .render-log tr.render-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
/* The stacked cabinet (≤ 900 px, no sidebar beside the page): the two buttons
   one under the other, so the pinned column takes 149 px instead of 251. */
@media (max-width: 900px) {
  .acp .render-log .render-row__actions {
    flex-direction: column;
    align-items: stretch;
  }
}
/* Every render of a clip on its card (ClipRenders), each a button opening the
   player. The current one — what the card shows and decides — is marked. */
.acp .clip-renders {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1219;
}
.acp .clip-renders > h3 {
  color: var(--text);
  font-size: 12px;
}
.acp .clip-renders__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.acp .clip-render {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.acp .clip-render:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
}
.acp .clip-render:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.acp .clip-render.is-current {
  border-color: rgba(104, 181, 255, 0.45);
  background: rgba(104, 181, 255, 0.06);
}
.acp .clip-render__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.acp .clip-render__when {
  margin-right: auto;
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.acp .clip-render__what {
  font-size: 10px;
  line-height: 14px;
  overflow-wrap: anywhere;
}
.acp .clip-render .status {
  white-space: normal;
}
/* The render player dialog: a vertical file as tall as the window allows. The
   220 px are the dialog's header, padding and the QC line under the player. */
.acp .render-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.acp .render-player > .media-player--portrait {
  width: min(100%, 360px, calc((100dvh - 220px) * 9 / 16));
}
.acp .render-player > .notice {
  align-self: stretch;
}
.acp .render-player__qc {
  color: var(--text-secondary);
  font-size: 11px;
}
/* Templates */
.acp .master-detail--templates {
  grid-template-columns: clamp(360px, 34%, 420px) minmax(0, 1fr);
}
.acp .template-row {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 94px;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.acp .template-row:hover {
  background: rgba(255, 255, 255, 0.018);
}
.acp .template-row.is-selected {
  background: var(--surface-selected);
}
.acp .template-row.is-selected::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  content: "";
}
.acp .template-row__preview {
  position: relative;
  width: 48px;
  height: 70px;
  justify-self: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #05070a;
}
.acp .template-row__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.acp .template-row__preview span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  left: 4px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}
.acp .template-row__copy,
.acp .template-row__meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}
.acp .template-row__copy strong,
.acp .template-row__copy span,
.acp .template-row__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .template-row__copy strong {
  font-size: 12px;
  font-weight: 600;
}
.acp .template-row__copy span {
  color: var(--text-secondary);
  font-size: 10px;
}
.acp .template-row__copy small,
.acp .template-row__meta small {
  color: var(--text-subtle);
  font-size: 9px;
}
.acp .template-row__meta {
  align-items: flex-end;
}
.acp .template-inspector__body {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(260px, 0.9fr) minmax(290px, 1.1fr);
  align-items: start;
  gap: 14px;
  overflow-y: auto;
  padding: 14px;
}
.acp .template-inspector__preview {
  display: flex;
  min-height: 100%;
  align-items: flex-start;
  justify-content: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080a0f;
}
.acp .template-inspector__info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.acp .template-canvas {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #030508;
}
.acp .template-canvas__camera,
.acp .template-canvas__game {
  position: absolute;
  right: 0;
  left: 0;
  overflow: hidden;
}
.acp .template-canvas__camera {
  top: 0;
  height: var(--split);
  border-bottom: 2px solid var(--info);
}
.acp .template-canvas__game {
  bottom: 0;
  height: calc(100% - var(--split));
  border-top: 2px solid var(--accent);
}
.acp .template-canvas__camera img,
.acp .template-canvas__game img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.acp .template-canvas__camera > span,
.acp .template-canvas__game > span {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(3, 5, 8, 0.84);
  color: var(--text-secondary);
  font-size: 8px;
}
.acp .template-canvas__hook,
.acp .template-canvas__captions {
  position: absolute;
  z-index: 3;
  right: 6%;
  left: 6%;
  padding: 4px 5px;
  border: 1px solid rgba(255, 200, 107, 0.72);
  border-radius: 4px;
  background: rgba(6, 8, 12, 0.72);
  color: #fff;
  font-size: clamp(7px, 0.65vw, 10px);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
}
.acp .template-canvas__hook {
  top: var(--hook-y);
}
.acp .template-canvas__captions {
  top: var(--captions-y);
  border-color: rgba(118, 228, 181, 0.72);
}
.acp .template-canvas__hook.is-editable,
.acp .template-canvas__captions.is-editable {
  box-shadow: 0 0 0 2px rgba(255, 200, 107, 0.12);
}
.acp .template-canvas__captions.is-editable {
  box-shadow: 0 0 0 2px rgba(118, 228, 181, 0.12);
}
.acp .template-canvas__format {
  position: absolute;
  z-index: 4;
  right: 5px;
  bottom: 5px;
  padding: 2px 4px;
  border-radius: 3px;
  background: rgba(3, 5, 8, 0.78);
  color: var(--text-subtle);
  font-size: 7px;
}
.acp .template-editor {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px 9px 0 0;
  background: var(--surface);
}
.acp .template-editor__body {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(420px, 1fr) minmax(300px, 370px);
}
.acp .template-editor__stage {
  display: flex;
  min-height: 0;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #080a0f;
}
.acp .template-editor__stage .template-canvas {
  width: min(100%, 380px);
}
.acp .template-editor__controls {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 14px;
}
.acp .editor-control-group {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1219;
}
.acp .editor-control-group h3 {
  font-size: 13px;
}
.acp .coordinate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.acp .code-field textarea {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.6;
}
/* Team */
.acp .team-panel,
.acp .recovery-panel {
  min-height: 0;
}
.acp .access-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(460px, 1.3fr);
  align-items: start;
  gap: 14px;
}
.acp .access-guide {
  padding: 16px;
}
.acp .access-guide .panel__header {
  min-height: 0;
  padding: 0 0 14px;
  border-bottom: 0;
}
.acp .access-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: flex-start;
  gap: 10px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.acp .access-step > span {
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}
.acp .access-step > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.acp .access-step strong {
  font-size: 12px;
}
.acp .access-step p {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 16px;
}
.acp .recovery-list {
  display: flex;
  max-height: 560px;
  flex-direction: column;
  overflow-y: auto;
}
.acp .recovery-row {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
}
.acp .recovery-row:last-child {
  border-bottom: 0;
}
.acp .link-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  text-align: center;
}
.acp .link-result__icon {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
}
.acp .link-result > div:not(.copy-field) {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.acp .link-result strong {
  font-size: 14px;
}
.acp .link-result p {
  color: var(--text-secondary);
  font-size: 11px;
}
.acp .copy-field {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
/* Live */
.acp .priority-value {
  display: inline-flex;
  min-width: 34px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.acp .lease-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.acp .lease-cell button {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
}
.acp .lease-cell button:hover {
  background: var(--danger-bg);
  color: var(--danger);
}
.acp .runs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 14px;
}
.acp .run-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}
.acp .live-run-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1219;
}
.acp .live-run-card__top {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.acp .live-run-card__top > div {
  min-width: 0;
}
.acp .live-run-card h3 {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .live-run-card p {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 10px;
}
.acp .live-run-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.acp .live-run-card__metrics span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-subtle);
  font-size: 9px;
  text-align: center;
}
.acp .live-run-card__metrics b {
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}
.acp .component-health {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--text-secondary);
  font-size: 9px;
}
.acp .component-health span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.acp .health-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-subtle);
}
.acp .health-dot--good {
  background: var(--success);
}
.acp .live-run-card footer {
  display: flex;
  min-height: 34px;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}
.acp .leases-panel {
  min-width: 0;
}
.acp .current-leases {
  display: flex;
  flex-direction: column;
}
.acp .current-leases > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.acp .current-leases > div:last-child {
  border-bottom: 0;
}
.acp .current-leases > div > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.acp .current-leases strong {
  font-size: 11px;
}
.acp .current-leases span {
  color: var(--text-secondary);
  font-size: 10px;
}
.acp .analytics-page,
.acp .progress-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.acp .analytics-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 14px;
}
.acp .advanced-settings {
  border: 1px solid var(--line);
  border-radius: 8px;
}
.acp .advanced-settings summary {
  padding: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.acp .advanced-settings__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}
/* Data */
.acp .import-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}
.acp .import-panel {
  padding-bottom: 0;
}
.acp .import-panel > .field,
.acp .import-panel > .notice {
  margin: 14px 14px 0;
}
.acp .panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #0e1219;
}
.acp .export-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(350px, 0.95fr);
  align-items: stretch;
  gap: 14px;
}
.acp .export-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  padding: 22px;
}
.acp .export-icon {
  display: inline-flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(118, 228, 181, 0.3);
  border-radius: 10px;
  background: var(--surface-selected);
  color: var(--accent);
}
.acp .export-card__copy {
  min-width: 0;
}
.acp .export-card__copy h2 {
  font-size: 21px;
}
.acp .export-card__copy p {
  max-width: 560px;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 18px;
}
.acp .export-card__meta {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.acp .export-card__meta > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 10px;
  border-right: 1px solid var(--line);
}
.acp .export-card__meta > div:last-child {
  border-right: 0;
}
.acp .export-card__meta span {
  color: var(--text-subtle);
  font-size: 10px;
}
.acp .export-card__meta strong {
  color: var(--text);
  font-size: 12px;
}
.acp .export-card > .button {
  grid-column: 1 / -1;
  justify-self: start;
}
.acp .manifest-list {
  display: flex;
  flex-direction: column;
}
.acp .manifest-list > div {
  display: grid;
  min-height: 62px;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
}
.acp .manifest-check {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
}
.acp .manifest-list > div > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.acp .manifest-list strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}
.acp .manifest-list span,
.acp .manifest-list small {
  color: var(--text-secondary);
  font-size: 10px;
}
.acp .export-manifest > .notice {
  margin: 13px;
}
@media (max-width: 1250px) {
  .acp .app-shell {
    --sidebar-width: 72px;
  }
  .acp .sidebar__brand-row {
    justify-content: center;
    padding: 0;
  }
  .acp .brand__name,
.acp .nav-item > span:not(.nav-count),
.acp .nav-group__label,
.acp .profile-button__copy,
.acp .profile-button > svg,
.acp .nav-count,
.acp .sidebar__collapse {
    display: none;
  }
  .acp .nav-item {
    display: flex;
    justify-content: center;
    padding: 0;
  }
  .acp .profile-button {
    display: flex;
    justify-content: center;
    padding: 0;
  }
  .acp .page--standard {
    padding-inline: 20px;
  }
  .acp .page--workspace {
    padding-inline: 18px;
  }
  .acp .master-detail,
.acp .master-detail--templates {
    grid-template-columns: 335px minmax(0, 1fr);
  }
  .acp .clip-row,
.acp .record-row {
    grid-template-columns: 74px minmax(0, 1fr);
  }
  .acp .clip-row img,
.acp .record-row img {
    width: 74px;
    height: 44px;
  }
  .acp .clip-row__state,
.acp .record-row > .status {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .acp .run-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1020px) {
  .acp .stats-grid--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .acp .assignment-layout,
.acp .runs-layout,
.acp .access-layout,
.acp .export-layout {
    grid-template-columns: 1fr;
  }
  .acp .assignment-summary {
    display: grid;
    grid-template-columns: 1fr;
  }
  .acp .assignment-summary .stats-grid--vertical {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .acp .research-layout {
    grid-template-columns: 330px minmax(0, 1fr);
  }
  .acp .job-list {
    grid-template-columns: 1fr;
  }
  .acp .job-row {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .acp .job-row:last-child {
    border-bottom: 0;
  }
  .acp .analytics-grid {
    grid-template-columns: 1fr;
  }
  .acp .template-editor__body {
    grid-template-columns: minmax(360px, 1fr) 320px;
  }
}
@media (max-width: 900px) {
  .acp .app-shell,
.acp .app-shell.has-collapsed-sidebar {
    display: block;
    --sidebar-width: 280px;
  }
  .acp .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }
  .acp .sidebar.is-open {
    transform: translateX(0);
  }
  .acp .sidebar-scrim {
    position: fixed;
    z-index: 29;
    inset: 0;
    display: block;
    border: 0;
    background: var(--overlay);
  }
  .acp .sidebar__brand-row {
    justify-content: space-between;
    padding: 0 18px;
  }
  .acp .brand__name,
.acp .nav-item > span:not(.nav-count),
.acp .nav-group__label,
.acp .profile-button__copy,
.acp .profile-button > svg,
.acp .nav-count {
    display: initial;
  }
  .acp .nav-item {
    display: grid;
    justify-content: initial;
    padding: 0 12px;
  }
  .acp .profile-button {
    display: grid;
    justify-content: initial;
    padding: 7px;
  }
  .acp .sidebar__mobile-close {
    display: inline-flex !important;
  }
  .acp .sidebar__collapse {
    display: none;
  }
  .acp .app-main {
    height: 100dvh;
  }
  .acp .mobile-topbar {
    display: flex;
    height: 56px;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
    background: var(--shell);
  }
  .acp .mobile-topbar .brand__name {
    display: inline;
  }
  .acp .page {
    height: calc(100dvh - 56px);
  }
  .acp .page--standard,
.acp .page--workspace {
    overflow-y: auto;
    padding: 18px 16px 24px;
  }
  .acp .page--workspace {
    display: block;
  }
  .acp .page-header {
    min-height: 60px;
  }
  .acp .page-header h1 {
    font-size: 24px;
  }
  .acp .page-toolbar,
.acp .montage-toolbar {
    align-items: flex-end;
    flex-direction: column;
  }
  .acp .tabs {
    width: 100%;
    overflow-x: auto;
  }
  .acp .toolbar-actions {
    width: 100%;
    padding-bottom: 8px;
  }
  .acp .search-field {
    width: 100%;
  }
  .acp .master-detail,
.acp .master-detail--templates {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
  }
  .acp .queue-panel {
    min-height: 360px;
    max-height: 440px;
    border-radius: 9px;
  }
  .acp .inspector,
.acp .template-inspector,
.acp .template-editor {
    min-height: 720px;
    border-radius: 9px;
  }
  .acp .research-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .acp .research-jobs-panel {
    grid-column: auto;
  }
  .acp .record-list {
    max-height: 340px;
  }
  .acp .import-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 680px) {
  .acp .page-header {
    align-items: stretch;
    flex-direction: column;
  }
  .acp .page-header__actions .button {
    width: 100%;
  }
  .acp .tabs {
    gap: 0;
  }
  .acp .tab {
    padding-inline: 8px;
    font-size: 12px;
  }
  .acp .toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .acp .toolbar-actions > * {
    width: 100%;
  }
  .acp .select-wrap select {
    width: 100%;
  }
  .acp .assignment-summary .stats-grid--vertical,
.acp .stats-grid--four,
.acp .benchmark-stats,
.acp .benchmark-overview,
.acp .run-cards,
.acp .import-grid,
.acp .field-row,
.acp .choice-list--two {
    grid-template-columns: 1fr;
  }
  .acp .capacity-row__coverage {
    grid-template-columns: 1fr;
  }
  .acp .capacity-row__top,
.acp .capacity-row__bottom {
    align-items: flex-start;
    flex-direction: column;
  }
  .acp .selection-grid,
.acp .render-review,
.acp .template-inspector__body {
    grid-template-columns: 1fr;
  }
  .acp .portrait-composition {
    width: min(260px, 100%);
    margin-inline: auto;
  }
  .acp .template-editor__body {
    display: flex;
    flex-direction: column;
  }
  .acp .template-editor__stage {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .acp .inspector__footer,
.acp .drawer__footer,
.acp .modal__footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .acp .inspector__footer .button,
.acp .drawer__footer .button,
.acp .modal__footer .button {
    width: 100%;
  }
  .acp .review-secondary-actions {
    width: 100%;
    flex-direction: column;
  }
  .acp .review-secondary-actions .button {
    width: 100%;
  }
  .acp .export-card {
    grid-template-columns: 1fr;
  }
  .acp .export-card__meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .acp .export-card__meta > div:nth-child(2) {
    border-right: 0;
  }
  .acp .overlay--center {
    padding: 8px;
  }
  .acp .modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
  .acp .drawer {
    width: 100vw;
  }
  .acp .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }
}

/* Publishing */
/* «Публикация» по дизайну PUB1 (docs/run/2026-10-29-evelone-gensyxa/design/
   PUB1-publishing.md §5, правила — 20-publishing.css). Секция стоит после
   правил ≤ 900 и ≤ 680 px, поэтому всё, что разбирает сетку карточки или
   очереди, закрыто условием ширины: иначе на телефоне оно перебило бы
   одноколоночную раскладку тех правил порядком в файле. Старый блок
   «--- Публикация» ниже по файлу (подпись, настройки, .master-detail--release)
   остаётся: эта секция его не повторяет, а `.page--publishing` выше по
   специфичности, где ширины расходятся. */

/* Раскладка решает по ширине страницы, а не окна: свёрнутый сайдбар даёт
   странице ту же ширину, что окно на 148 px шире. */
.acp .page--publishing {
  container: pubpage / inline-size;
  grid-template-rows: auto minmax(0, 1fr);
}
.acp .page--publishing .page-header {
  min-height: 0;
  padding-bottom: 12px;
}

/* Узко (< 1400 px контента): выбор — строка над работой. Широко: колонка
   232 px слева, как у live clipper (docs/design/README.md: 220–235 px). DOM
   один, меняется только CSS. */
.acp .pub-layout {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}
.acp .pub-work {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

/* --- выбор: стример → аккаунт --- */
.acp .pub-scope {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
/* Группа, которой не хватило строки, переносится на вторую; длинная группа
   (десять стримеров) прокручивается вбок внутри себя. */
.acp .pub-scope__group {
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}
.acp .pub-scope__label {
  flex: 0 0 auto;
  margin: 0 4px 0 0;
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.acp .pub-scope__note {
  padding: 0 6px;
}
.acp .pub-scope__item {
  position: relative;
  display: grid;
  min-width: 0;
  max-width: 240px;
  min-height: 36px;
  flex: 0 0 auto;
  align-content: center;
  gap: 1px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.acp .pub-scope__item:hover {
  background: var(--surface-hover);
}
.acp .pub-scope__item.is-selected {
  border-color: rgba(118, 228, 181, 0.45);
  background: var(--surface-selected);
}
.acp .pub-scope__item strong,
.acp .pub-scope__item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .pub-scope__item strong {
  font-size: 12px;
  font-weight: 600;
}
.acp .pub-scope__item small {
  color: var(--text-secondary);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
/* Нечего делать — приглушён, но кликабелен: выбор не запрещён, он пуст. */
.acp .pub-scope__item.is-idle strong {
  color: var(--text-secondary);
}
.acp .pub-scope__divider {
  display: none;
}
.acp .pub-scope__foot {
  flex: 0 0 auto;
  margin-left: auto;
}
.acp .pub-scope__item .render-spinner {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 14px;
  height: 14px;
  margin-top: -7px;
}

@container pubpage (width >= 1400px) {
  .acp .pub-layout {
    grid-template-columns: 232px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .acp .pub-scope {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 12px 10px;
    flex-wrap: nowrap;
    overflow-y: auto;
    border-radius: 9px 9px 0 0;
  }
  .acp .pub-scope__group {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    overflow: visible;
  }
  .acp .pub-scope__label {
    margin: 0 0 6px 6px;
  }
  .acp .pub-scope__item {
    max-width: none;
    min-height: 48px;
    padding: 6px 10px 6px 12px;
    border-color: transparent;
  }
  .acp .pub-scope__item.is-selected {
    border-color: transparent;
  }
  /* Та же метка выбора, что у строки очереди (.clip-row.is-selected::before). */
  .acp .pub-scope__item.is-selected::before {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;
    width: 3px;
    border-radius: 2px;
    background: var(--accent);
    content: "";
  }
  .acp .pub-scope__divider {
    display: block;
    height: 1px;
    flex: 0 0 auto;
    background: var(--line);
  }
  .acp .pub-scope__foot {
    margin: auto 0 0;
  }
  .acp .pub-scope__foot .button {
    width: 100%;
    justify-content: flex-start;
  }
}

/* --- очередь --- */
/* Только там, где очередь и карточка стоят рядом: ≤ 900 px правило выше
   ставит их столбиком, и колонка здесь была бы лишней. */
@media (min-width: 901px) {
  .acp .page--publishing .master-detail--release {
    grid-template-columns: clamp(300px, 28%, 380px) minmax(0, 1fr);
  }
}
/* Строки за краем очереди не раскладываются, пока до них не докрутили: на
   «Готовых» в 1000 клипов вход на этап занимал ~200 мс, почти всё — раскладка
   невидимых строк (PUB1 §3, «1000 клипов»: порог 100 мс). Высота-заглушка —
   строка «Готовых» в три строки текста. */
.acp .page--publishing .clip-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 82px;
}
/* Пустой этап: одно сообщение на ширину очереди и карточки, а не две пустые
   панели рядом (снимок 08). */
.acp .master-detail > .pub-empty {
  grid-column: 1 / -1;
  display: grid;
  min-height: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px 9px 0 0;
  background: var(--surface);
}
.acp .pub-empty__actions {
  justify-content: center;
}
/* «Аккаунты и настройки» стоят на месте очереди и карточки. */
.acp .pub-settings {
  display: grid;
  min-height: 0;
  padding-top: 10px;
}

/* Фоновая загрузка: прежнее остаётся на экране, приглушённое и некликабельное,
   пока не придёт новое. Без «Загружаем данные…» на весь экран. */
.acp .pub-busy {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 120ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .acp .pub-busy {
    transition: none;
  }
}

/* --- карточка --- */
/* Две колонки от 530 px карточки, три от 1000 px (окно 2000 и шире): файл,
   работа, сведения. Уже 530 px — одна, правило «Narrow inspector». */
@container inspector (width >= 530px) {
  .acp .render-review--release {
    grid-template-columns: minmax(0, 19fr) minmax(300px, 21fr);
    /* Плеер занимает две строки; лишняя высота уходит во вторую, чтобы
       сведения стояли сразу под работой, а не посередине пустоты. */
    grid-template-rows: auto minmax(0, 1fr);
  }
  .acp .render-review--release > .render-review__media {
    grid-row: span 2;
  }
  .acp .render-review--release > .pub-aside {
    grid-column: 2;
  }
}
@container inspector (width >= 1000px) {
  .acp .render-review--release {
    grid-template-columns: minmax(280px, 380px) minmax(420px, 760px) minmax(240px, 1fr);
  }
  .acp .render-review--release > .pub-aside {
    grid-column: 3;
    grid-row: 1;
  }
}
.acp .pub-main,
.acp .pub-aside {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
}

/* Путь клипа: подпись → файл → ссылка → автор → метрики. */
.acp .pub-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.acp .pub-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1219;
}
.acp .pub-step.is-current {
  border-color: rgba(118, 228, 181, 0.45);
}
.acp .pub-step__marker {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}
.acp .pub-step.is-current .pub-step__marker {
  border-color: var(--accent);
  color: var(--accent);
}
.acp .pub-step.is-done .pub-step__marker {
  border-color: transparent;
  background: var(--success-bg);
  color: var(--success);
}
.acp .pub-step.is-failed .pub-step__marker {
  border-color: transparent;
  background: var(--danger-bg);
  color: var(--danger);
}
.acp .pub-step__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
}
.acp .pub-step__head {
  display: flex;
  min-height: 24px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 10px;
}
.acp .pub-step__head h3 {
  font-size: 13px;
}
.acp .pub-step__summary {
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.5;
}
/* Закрытый шаг: заголовок и одна строка причины, без полей. */
.acp .pub-step.is-locked h3 {
  color: var(--text-secondary);
}
.acp .pub-step.is-locked .pub-step__summary {
  color: var(--text-subtle);
}

/* ------------------------------------------------------------------------- */
/* Takeover of the document shell.                                           */
/*                                                                           */
/* The redesign carries its own brand, navigation and profile menu inside the */
/* sidebar, so the topbar from index.html would be a second, competing one.   */
/* This is the same mechanism the live workspace already uses for its         */
/* one-screen layout (`main.live-view` in styles.css): the admin root asks for */
/* the whole viewport and the document chrome steps aside.                    */
/* ------------------------------------------------------------------------- */

body:has(main.admin-view) {
  overflow: hidden;
}

body:has(main.admin-view) .topbar {
  display: none;
}

main.admin-view {
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* 100vw would add the scrollbar's width to the grid and push the page into a
   horizontal scroll on Windows; the main element is already viewport-wide. */
.acp .app-shell {
  width: 100%;
}

/* The shell's own <main class="app-main"> (admin/shell.js) also matches the
   clipper's bare `main { width: min(1500px, 100%); margin: 0 auto; padding }`
   in styles.css: the cabinet stopped at 1500 px, centred, with an extra 32 px
   field on every side, so the wide layouts never switched on (PUB1, request
   B). The cabinet column takes everything right of the sidebar; spacing
   belongs to the page classes (`.page--standard`, `.page--workspace`), and a
   screen that must not stretch caps itself inside its own section. */
.acp .app-main {
  width: auto;
  margin: 0;
  padding: 0;
}

/* The legacy banner and save indicator live outside <main>, so they survive the
   takeover. They are kept — an error must never be swallowed — but restyled to
   the new palette and lifted out of the layout, since admin screens report
   through the toast and these two only fire from shared shell code. */
body:has(main.admin-view) #global-error.banner {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 90;
  width: min(560px, calc(100vw - 24px));
  margin: 0;
  transform: translateX(-50%);
  border-color: rgba(255, 125, 140, 0.4);
  border-radius: 10px;
  background: #1a1015;
  color: var(--danger);
  font-size: 12px;
}

body:has(main.admin-view) #save-status {
  right: 16px;
  bottom: 16px;
  color: var(--text-subtle);
  font-size: 12px;
}

/* ------------------------------------------------------------------------- */
/* Profile menu.                                                             */
/*                                                                           */
/* The prototype's profile button answered with a toast saying the area was   */
/* out of scope. Production has to carry what the old topbar did — who you    */
/* are signed in as, and the way out — so the button opens a real menu.       */
/* ------------------------------------------------------------------------- */

.acp .sidebar__footer {
  position: relative;
}

.acp .acp-profile-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 10px;
  z-index: 40;
  display: flex;
  width: max-content;
  min-width: 190px;
  max-width: calc(100vw - 32px);
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.acp .acp-profile-menu__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.acp .acp-profile-menu__head strong {
  font-size: 13px;
  font-weight: 600;
}

.acp .acp-profile-menu__action {
  justify-content: flex-start;
}

/* Collapsed to 72 px the footer is too narrow to hang a menu off its left
   edge without leaving the viewport. */
.acp .has-collapsed-sidebar .acp-profile-menu {
  left: 0;
}

/* ------------------------------------------------------------------------- */
/* Production media surfaces.                                               */
/*                                                                          */
/* The prototype used still images and a decorative control bar. These are   */
/* the working parts: a real player, the frame marker that writes the        */
/* rectangles a render uses, and the 9:16 preview drawn from the plan.       */
/* ------------------------------------------------------------------------- */

.acp .media-player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #040609;
}

.acp .media-player--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
  text-align: center;
}

.acp .media-player--empty p {
  max-width: 30ch;
  color: var(--text-secondary);
  font-size: 12px;
}

.acp .media-player--empty svg {
  color: var(--warning);
}

/* --- frame marker -------------------------------------------------------- */

.acp .frame-marker {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

/* The surface takes the clip's own shape, set from JS as `--frame-aspect` once
 * the size is known. It used to inherit the player's fixed 16/9, so a 4:3 or a
 * vertical source was letterboxed inside it — and a rectangle drawn against the
 * whole box landed on part of the source frame that was not under the pointer.
 * rect-edit.js maps through the picture's real content box in any case; this is
 * what makes the bars zero in the ordinary case. */
.acp .frame-marker__surface {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #05070a;
  aspect-ratio: var(--frame-aspect, 16 / 9);
  cursor: default;
  touch-action: none;
}

.acp .frame-marker__surface:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.acp .frame-marker__surface.is-drawing {
  border-color: var(--accent);
}

/* Armed to draw a new rectangle, and only then: an ordinary press on the picture
 * moves what is already there rather than replacing it. */
.acp .frame-marker__surface.is-creating {
  cursor: crosshair;
}

.acp .frame-marker__surface .media-player {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  aspect-ratio: auto;
}

/* The player must not swallow the drag that moves a rectangle. `contain` so the
 * whole frame is visible: a cropped picture would hide the very corner somebody
 * is being asked to outline. */
.acp .frame-marker__surface video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.acp .frame-marker__rect {
  position: absolute;
  border: 2px solid var(--accent);
  background: rgba(118, 228, 181, 0.12);
  pointer-events: none;
}

/* The one being edited takes the pointer; the other stays a drawing. Two live
 * rectangles under one cursor would make "which am I dragging" a guess. */
.acp .frame-marker__surface.is-marking .frame-marker__rect.is-active {
  pointer-events: auto;
  cursor: move;
}

.acp .frame-marker__handle {
  position: absolute;
  width: 11px;
  height: 11px;
  border: 1px solid #05070a;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}

.acp .frame-marker__rect--webcam .frame-marker__handle {
  background: var(--info);
}

.acp .frame-marker__surface.is-marking .frame-marker__rect.is-active .frame-marker__handle {
  opacity: 1;
  pointer-events: auto;
}

.acp .frame-marker__handle--nw {
  top: -6px;
  left: -6px;
  cursor: nwse-resize;
}
.acp .frame-marker__handle--n {
  top: -6px;
  left: calc(50% - 5px);
  cursor: ns-resize;
}
.acp .frame-marker__handle--ne {
  top: -6px;
  right: -6px;
  cursor: nesw-resize;
}
.acp .frame-marker__handle--e {
  top: calc(50% - 5px);
  right: -6px;
  cursor: ew-resize;
}
.acp .frame-marker__handle--se {
  right: -6px;
  bottom: -6px;
  cursor: nwse-resize;
}
.acp .frame-marker__handle--s {
  bottom: -6px;
  left: calc(50% - 5px);
  cursor: ns-resize;
}
.acp .frame-marker__handle--sw {
  bottom: -6px;
  left: -6px;
  cursor: nesw-resize;
}
.acp .frame-marker__handle--w {
  top: calc(50% - 5px);
  left: -6px;
  cursor: ew-resize;
}

.acp .frame-marker__rect--webcam {
  border-color: var(--info);
  background: rgba(104, 181, 255, 0.14);
}

.acp .frame-marker__rect b {
  position: absolute;
  top: 0;
  left: 0;
  padding: 1px 5px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
}

.acp .frame-marker__rect--webcam b {
  background: var(--info);
  color: #06121f;
}

.acp .frame-marker__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.acp .frame-marker__mode {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.acp .frame-marker__mode:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.acp .frame-marker__mode.is-active {
  border-color: var(--accent);
  background: var(--surface-selected);
  color: var(--text);
}

.acp .region-dot--camera {
  background: var(--info);
}

.acp .frame-marker__suggestion {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
}

.acp .frame-marker__suggestion svg {
  flex: 0 0 auto;
  color: var(--accent);
}

.acp .frame-marker__suggestion > div {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1px;
}

.acp .frame-marker__suggestion strong {
  font-size: 12px;
  font-weight: 600;
}

.acp .frame-marker__suggestion span {
  color: var(--text-secondary);
  font-size: 11px;
}

/* --- vertical preview ---------------------------------------------------- */

.acp .portrait-preview canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.acp .portrait-preview__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.acp .portrait-preview__slot {
  position: absolute;
  border: 1px dashed rgba(118, 228, 181, 0.5);
}

.acp .portrait-preview__slot--webcam,
.acp .portrait-preview__slot--guest_cam {
  border-color: rgba(104, 181, 255, 0.55);
}

.acp .portrait-preview__slot b {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 0 4px;
  background: rgba(5, 7, 10, 0.78);
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 500;
}

.acp .portrait-preview__text {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border: 1px solid rgba(255, 200, 107, 0.5);
  text-align: center;
}

.acp .portrait-preview__text span {
  overflow: hidden;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acp .portrait-preview__captions {
  border-color: rgba(104, 181, 255, 0.5);
}

.acp .safe-area {
  position: absolute;
  border: 1px dashed rgba(152, 164, 183, 0.35);
  pointer-events: none;
}

/* Under 680 px the preview stops competing with the marker for one row. */
@media (max-width: 680px) {
  .acp .portrait-composition {
    width: min(100%, 210px);
    margin-inline: auto;
  }
}

/* ------------------------------------------------------------------------- */
/* Template canvas — production variants.                                    */
/*                                                                           */
/* The prototype hard-coded a camera box and a game box. A real template body */
/* declares its slots, so the canvas draws whatever the body has, and the two */
/* named looks become slot modifiers.                                         */
/* ------------------------------------------------------------------------- */

.acp .template-canvas__slot {
  position: absolute;
  overflow: hidden;
  border: 1px solid var(--accent);
  background: rgba(118, 228, 181, 0.07);
}

.acp .template-canvas__slot--webcam {
  border-color: var(--info);
  background: rgba(104, 181, 255, 0.09);
}

.acp .template-canvas__slot--broll {
  border-color: var(--warning);
  background: rgba(255, 200, 107, 0.08);
}

.acp .template-canvas__slot > span {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 1px 5px;
  background: rgba(5, 7, 10, 0.8);
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 500;
}

/* A JSON body shown for reading, not editing. */
.acp .code-block {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b0e14;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  tab-size: 2;
  white-space: pre;
}

/* The editor's back link sits in the toolbar row on its own. */
.acp .page--workspace > .page-toolbar:has(> .button:only-child) {
  justify-content: flex-start;
}

/* A table cell holding a right-aligned number or action. */
.acp .data-table th.is-right,
.acp .data-table td.is-right {
  text-align: right;
}

.acp .data-table td.is-right .button,
.acp .data-table td.is-right .table-progress {
  justify-content: flex-end;
  margin-left: auto;
}

/* The moments inspector lists the clips already cut from a moment; the table
   inside a panel-less inspector needs its own top rule. */
.acp .inspector__body > .table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* ------------------------------------------------------------------------- */
/* Queue panel with a heading.                                               */
/*                                                                           */
/* The prototype's queue panel was two rows — the scrolling list and the      */
/* footer. Production names each queue («На разметке», «Ожидают выдачи»,      */
/* «Моменты после кластерного ревью»), so a heading row is added when there   */
/* is a title; without this the fixed two-row grid pushed the list into the   */
/* footer's row.                                                             */
/* ------------------------------------------------------------------------- */

.acp .queue-panel:has(> .panel__header) {
  grid-template-rows: auto minmax(0, 1fr) 46px;
}

/* The prototype's rows led with a 96 px thumbnail. Production has no still for
   a clip that has not been rendered yet, so the copy takes that column and the
   row keeps its proportions instead of leaving a gap. */
.acp .clip-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

/* An empty state standing in for the list must not be centred inside a grid
   row sized for a list item. */
.acp .queue-panel__scroll > .empty-inspector {
  height: 100%;
}

/* A composition that cannot be built yet says which step is missing. */
.acp .portrait-preview--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.acp .portrait-preview--empty p {
  color: var(--text-subtle);
  font-size: 11px;
  text-align: center;
}

/* The download control is a link, not a button — the endpoint answers with the
   file itself. In the card's grid it must not stretch to fill the leftover row
   the way a block-level child otherwise would. */
.acp .export-card > .button {
  align-self: start;
  min-height: 34px;
}

/* ------------------------------------------------------------------------- */
/* Narrow-width corrections found in the 820 px pass.                        */
/* ------------------------------------------------------------------------- */

/* The search field asks for 210 px and the filter select for its widest option;
   side by side they exceed what the tabs leave over. Allowed to shrink they both
   fit on one row, so only the stacked toolbar below 900 px wraps — wrapping on
   desktop split them onto two rows with room to spare. */
.acp .toolbar-actions .field--compact {
  min-width: 0;
}

@media (max-width: 900px) {
  .acp .toolbar-actions {
    flex-wrap: wrap;
  }
}

/* The template strip is a two-column grid (icon + copy). Production adds a link
   to the template's editor, which had nowhere to go and was crushed to the width
   of its own border; it now takes a row of its own. */
.acp .template-applied {
  grid-template-columns: 22px minmax(0, 1fr) auto;
}

.acp .template-applied > .button {
  align-self: center;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .acp .template-applied {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .acp .template-applied > .button {
    grid-column: 2;
    justify-self: start;
  }
}

/* ------------------------------------------------------------------------- */
/* Phone-width corrections found in the 390 px pass.                         */
/* ------------------------------------------------------------------------- */

@media (max-width: 680px) {
  /* Side by side, the status chip took the row and left the clip's name as an
     ellipsis. Stacked, the name gets the full width and the chip sits under it,
     which is the only arrangement where both stay readable.

     Flex rather than a one-column grid: the row's other children would land in
     an implicit second column and share the width all over again. */
  .acp .clip-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .acp .clip-row__state {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .acp .clip-row__state > small {
    margin-left: auto;
  }

  /* A long clip name and its badge must wrap rather than push the badge out of
     the panel. The inspector's header does this at every width (Montage
     section, `.acp .inspector__header`). */
  .acp .panel__header {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  /* Record and template rows have the same two-column problem. */
  .acp .record-row,
  .acp .template-row {
    flex-wrap: wrap;
    row-gap: 6px;
  }
}

@media (max-width: 900px) {
  /* The collapsed-rail rule hides the profile copy at 1020 px, and the drawer
     rule brings it back with `display: initial` — which for a <span> means
     `inline`, so the column direction stopped applying and the name ran into the
     role on one line. */
  .acp .profile-button__copy {
    display: flex;
  }
}

/* The prototype exported a Notice action slot but never used one, so it carried
   no rule. Production does use it — the empty benchmark state offers a way
   forward — and it needs to sit beside the copy rather than under it. */
.acp .notice__action {
  display: flex;
  flex-shrink: 0;
  align-items: center;
}

@media (max-width: 680px) {
  .acp .notice {
    flex-wrap: wrap;
  }

  .acp .notice__action {
    width: 100%;
  }
}

/* --- Ассеты: библиотека вставок ----------------------------------------- */

.acp .asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.acp .asset-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1219;
}
.acp .asset-card__frame {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: #080b10;
  cursor: pointer;
}
.acp .asset-card__frame:disabled {
  cursor: default;
}
.acp .asset-card__poster {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.acp .asset-card__poster--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  font-size: 10px;
}
.acp .asset-card__duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.acp .asset-card__body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
}
.acp .asset-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.acp .asset-card__heading h3 {
  margin: 0;
  font-size: 11px;
  line-height: 15px;
}
.acp .asset-card__error {
  margin: 0;
  color: var(--danger);
  font-size: 9px;
}
/* Provenance is the reason this library exists, so it reads as a table rather
   than as one more line of grey meta. */
.acp .asset-card__provenance {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  margin: 0;
  gap: 2px 8px;
  font-size: 9px;
}
.acp .asset-card__provenance dt {
  color: var(--text-subtle);
}
.acp .asset-card__provenance dd {
  overflow: hidden;
  margin: 0;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .asset-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--text-subtle);
  font-size: 9px;
}
.acp .asset-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.acp .asset-card__tags .tag {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 9px;
}
.acp .asset-preview {
  width: 100%;
  max-height: 60vh;
  border-radius: 6px;
  background: #000;
}

/* The native file input cannot be styled, so the label is the button and the
   input itself is only reachable through it. */
.acp .file-field {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}
.acp .file-field__input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.acp .file-field__label {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #131924;
  color: var(--text);
  font-size: 10px;
  cursor: pointer;
}
.acp .file-field__input:focus-visible + .file-field__name,
.acp .file-field__input:focus-visible ~ .file-field__label {
  outline: 2px solid var(--accent);
}
.acp .file-field__name {
  overflow: hidden;
  color: var(--text-subtle);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Вставки на клипе ---------------------------------------------------- */

.acp .insert-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.acp .insert-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0e1219;
}
.acp .insert-row__poster {
  width: 56px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  background: #080b10;
  object-fit: cover;
}
.acp .insert-row__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.acp .insert-row__copy strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .insert-row__copy span {
  color: var(--text-subtle);
  font-size: 9px;
}
.acp .insert-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}

@media (max-width: 680px) {
  .acp .insert-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Стримеры: профили каналов ------------------------------------------- */

.acp .profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.acp .profile-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1219;
}
/* The source frame, 16:9, with the camera where it actually sits. */
.acp .camera-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background: #080b10;
}
.acp .camera-frame__box {
  position: absolute;
  border: 1.5px solid var(--accent);
  border-radius: 3px;
  background: rgba(118, 228, 181, 0.14);
}
.acp .camera-frame__empty {
  color: var(--text-subtle);
  font-size: 10px;
}
.acp .profile-card__body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
}
.acp .profile-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.acp .profile-card__heading h3 {
  overflow: hidden;
  margin: 0;
  font-size: 11px;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .profile-card__facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  margin: 0;
  gap: 2px 8px;
  font-size: 9px;
}
.acp .profile-card__facts dt {
  color: var(--text-subtle);
}
.acp .profile-card__facts dd {
  overflow: hidden;
  margin: 0;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Счётчик знаков и состояние черновика делят одну строку под полем хука. */
.acp .hook-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* --- Журнал рендеров ----------------------------------------------------- */

.acp .render-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.acp .render-row__clip {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.acp .render-row__clip strong {
  font-size: 10px;
}
.acp .render-row__clip span {
  color: var(--text-subtle);
  font-size: 9px;
}
.acp .render-row__actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* The sound track.
 *
 * The editor has no timeline, and this is not one: it is the only place where
 * where a sound sits relative to the clip and to the other sounds is visible at
 * all. A cue is drawn at its own width so two stings a second apart do not read
 * as one, and the draft marker shows where the next click landed before
 * anything is saved. */
.acp .sound-strip {
  position: relative;
  height: 28px;
  margin-bottom: 12px;
  border-radius: 6px;
  background: #0d1118;
  border: 1px solid #1e2530;
  cursor: crosshair;
  overflow: hidden;
}
.acp .sound-strip__cue {
  position: absolute;
  top: 6px;
  bottom: 6px;
  min-width: 3px;
  border-radius: 3px;
  background: #4ea1ff;
}
.acp .sound-strip__draft {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #6ee7a8;
}

/* Time marks on the sound track. Without them a position is something you
 * guess at, and the whole point of the strip is that you can see where a sound
 * sits. */
.acp .sound-strip {
  padding-bottom: 12px;
}
.acp .sound-strip__tick {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  font-size: 9px;
  line-height: 10px;
  color: #5b6675;
  pointer-events: none;
}
.acp .sound-strip__tick::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 1px;
  height: 5px;
  background: #232b36;
}
.acp .insert-row .btn {
  flex: none;
}

/* --- Монтаж → На разметке: три колонки ------------------------------------ */
/*                                                                           */
/* The one stage that asks three questions at once — which clip, what is in   */
/* the frame, what will be rendered. As a single scrolling inspector the      */
/* vertical preview and the render button sat a page below the player they    */
/* describe, so placing a sound or checking a crop meant scrolling between    */
/* the two halves of one decision. Everything here is scoped to this tab: the */
/* other Монтаж tabs keep the two-column master-detail they were built as.    */

.acp .master-detail--markup {
  grid-template-columns: clamp(240px, 19vw, 270px) minmax(560px, 1fr) clamp(340px, 25vw, 380px);
}
/* Nothing selected, or a clip still being cut: the middle takes the rail's
 * width rather than leaving an empty third column beside an empty state. */
.acp .master-detail--markup > .markup-wide {
  min-width: 0;
  grid-column: 2 / -1;
}

.acp .markup-workbench {
  display: grid;
  min-width: 0;
  min-height: 0;
  gap: 10px;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px 9px 0 0;
  background: var(--surface);
}
.acp .markup-workbench__header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.acp .markup-workbench__title {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.acp .markup-workbench__title h2 {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .markup-workbench__title p {
  color: var(--text-secondary);
  font-size: 11px;
}
.acp .markup-workbench__tabs .tabs {
  gap: 2px;
}
.acp .markup-workbench__panel {
  min-height: 0;
  overflow-y: auto;
}

/* The picture, once, for both jobs: watching and marking. A second <video>
 * would double the fetch and let the two drift to different frames. */
/* Sized by width, never by height. The rectangles are fractions of this box,
 * so the box has to be exactly the picture: a letterboxed surface would map a
 * drawn rectangle onto the wrong part of the source frame. */
.acp .markup-media-stage {
  min-height: 0;
}
.acp .markup-media-stage .frame-marker__surface {
  display: block;
  /* Bounded by the viewport's height as well as the column's width, or on a
   * short screen the picture takes the room the controls under it need — and
   * an `auto` grid row lets it overflow rather than shrink.
   *
   * max-height is what a vertical clip needs: the surface takes the media's
   * aspect now, and a 9:16 source at this width would be taller than the
   * screen. When the cap bites the surface stops being the media's shape and
   * the picture is letterboxed inside it — which is fine and deliberate,
   * because the geometry maps through the real content box rather than through
   * the surface. */
  width: min(100%, 62vh);
  max-height: 62vh;
  margin-inline: auto;
}
.acp .markup-media-stage .media-player {
  width: 100%;
  min-height: 0;
}
/* Idle, the surface is an ordinary player with the saved rectangles drawn over
 * it, so the native controls have to get their clicks back. */
.acp .frame-marker__surface:not(.is-marking) {
  cursor: default;
}
.acp .frame-marker__surface:not(.is-marking) video {
  pointer-events: auto;
}
.acp .frame-marker__surface:not(.is-marking) .frame-marker__rect {
  opacity: 0.45;
}
.acp .frame-marker__controls {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

/* --- навигатор по отрезку ------------------------------------------------- */
/*                                                                           */
/* Read-only: it seeks and nothing else. The marks are drawn, never dragged,  */
/* and no call here writes bounds — they were decided in «Отборе моментов»    */
/* and a queued render already quotes them.                                   */

.acp .clip-navigator {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}
.acp .clip-navigator__bar {
  position: relative;
  display: block;
  width: 100%;
  height: 26px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d1118;
  cursor: pointer;
}
.acp .clip-navigator__bar:disabled {
  cursor: default;
  opacity: 0.5;
}
.acp .clip-navigator__segment {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(118, 228, 181, 0.16);
  pointer-events: none;
}
.acp .clip-navigator__mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--accent);
  pointer-events: none;
}
.acp .clip-navigator__mark--key {
  width: 1px;
  background: var(--info);
}
.acp .clip-navigator__playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: #f4f7fb;
  pointer-events: none;
}
.acp .clip-navigator__scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-subtle);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.acp .clip-navigator__span {
  color: var(--text-secondary);
}
.acp .clip-navigator__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.acp .clip-navigator__readout {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin-left: auto;
  color: var(--text-subtle);
  font-size: 10px;
}
.acp .clip-navigator__now {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* --- дорожка сцен --------------------------------------------------------- */
/*                                                                           */
/* The navigator above is one bar over the VOD; this is one lane over the     */
/* clip's own length, and every scene on it is a real <button>. That is not   */
/* decoration: the navigator reads clientX and has no keyboard path at all,   */
/* and a lane whose only way to cut a scene is a drag would be the same       */
/* defect with more features.                                                */
/*                                                                           */
/* Every position is written from JS with style.setProperty — CSP is          */
/* `style-src 'self'`, so a style attribute is dropped and each element       */
/* silently lands at left 0.                                                  */

.acp .timeline-lane {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.acp .timeline-lane__track {
  position: relative;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  touch-action: none;
}

/* The lane is the tab stop, not its scenes: the buttons are rebuilt on every
 * repaint and focus on one of them lands on the body a moment later, which
 * killed the keyboard after a single press. */
.acp .timeline-lane:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.acp .timeline-lane__track.is-dragging {
  border-color: var(--accent);
}

/* All three are transparent sheets over the track; only what is drawn on them
 * takes the pointer. The scenes layer did not say so, so it hit-tested over the
 * whole lane — a click on an uncovered stretch landed on an invisible div, the
 * seek handler's target check never matched, and seeking by pointer was dead
 * code behind a comment claiming it worked. */
.acp .timeline-lane__scenes,
.acp .timeline-lane__gaps,
.acp .timeline-lane__handles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.acp .timeline-lane__scene,
.acp .timeline-lane__handle {
  pointer-events: auto;
}

/* A stretch no scene covers. Drawn rather than left blank: an uncovered clip
 * is refused at confirm, and a lane that looked full would make that refusal
 * arrive from nowhere. */
.acp .timeline-lane__gap {
  position: absolute;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 125, 140, 0.16) 0 6px,
    transparent 6px 12px
  );
}

.acp .timeline-lane__scene {
  position: absolute;
  /* Above the playhead. Every scene, not only the selected one: the line has to
   * pass behind the labels everywhere, and the chips are translucent enough to
   * let it show through. */
  z-index: 1;
  top: 0;
  bottom: 0;
  display: flex;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 0;
  border-right: 1px solid var(--canvas);
  background: var(--surface-raised);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}

.acp .timeline-lane__scene:last-child {
  border-right: 0;
}

.acp .timeline-lane__scene:hover:not(:disabled) {
  color: var(--text);
}

.acp .timeline-lane__scene:focus-visible {
  z-index: 2;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.acp .timeline-lane__scene.is-active {
  z-index: 2;
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--text);
}

.acp .timeline-lane__scene:disabled {
  cursor: default;
}

/* Colour tints what the label already says. It is never the only signal: the
 * two states that block a render are also the two whose text says so. */
.acp .timeline-lane__scene--overlay_primary {
  background: rgba(118, 228, 181, 0.18);
}
.acp .timeline-lane__scene--fullcam {
  background: rgba(104, 181, 255, 0.18);
}
.acp .timeline-lane__scene--absent {
  background: var(--surface-raised);
}
.acp .timeline-lane__scene--transition {
  background: rgba(255, 200, 107, 0.16);
}
.acp .timeline-lane__scene--unknown,
.acp .timeline-lane__scene--ambiguous {
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 200, 107, 0.14) 0 5px,
    rgba(23, 28, 38, 0.9) 5px 10px
  );
}

.acp .timeline-lane__scene-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The grab target is wider than the line it draws: a boundary a person has to
 * hit within two pixels is a boundary they move by accident instead. It is also
 * the ONLY place a drag can start — a press anywhere else selects or seeks —
 * so the widening is what makes the boundary reachable rather than what makes
 * the rest of the lane dangerous. */
.acp .timeline-lane__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 9px;
  margin-left: -4px;
  background: linear-gradient(
    to right,
    transparent 0 3px,
    var(--accent) 3px 6px,
    transparent 6px 9px
  );
  cursor: ew-resize;
}

.acp .timeline-lane__track.is-dragging .timeline-lane__handle {
  z-index: 4;
}

/* Where the player is. Painted UNDER the scenes, which are translucent, so it
 * shows through them softened instead of cutting across them.
 *
 * It used to sit on top: a one-pixel line of `--text` straight through the
 * middle of a centred label, splitting «камера поверх» into «камера|поверх».
 * The owner read that as a scene that had lost its colour — «почему тут тогда
 * не покрашено» — and he was reading it correctly: a white gap through the
 * words of one chip and not the others says «this one is different», which is
 * exactly what colour on this lane is for. */
.acp .timeline-lane__playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--text);
  pointer-events: none;
}

.acp .timeline-lane__readout {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  color: var(--text-subtle);
  font-size: 10px;
}

.acp .timeline-lane__position {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.acp .timeline-lane__position svg {
  color: var(--accent);
}

.acp .scene-answers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.acp .scene-answers--rare {
  margin-top: 2px;
  opacity: .75;
}

/* The channel's known layouts, one click each. */
.acp .scene-layouts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.acp .scene-layouts__chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--acp-border, #263041);
  border-radius: 999px;
  padding: 0 2px 0 4px;
}

.acp .scene-answers__hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
}

/* --- правая колонка: что уйдёт в рендер ----------------------------------- */

.acp .markup-context-rail .inspector__header {
  min-height: 0;
  padding: 10px 12px;
}
/* The rail's title is a warning while the scenes tab is open («Черновик сцен —
 * ещё не подтверждено», montage.js): the picture under it is not what a render
 * would produce. Cut to an ellipsis, it lost the half that says so. */
.acp .markup-context-rail .inspector__header h2 {
  white-space: normal;
}
.acp .inspector__body--markup {
  display: grid;
  gap: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
}
/* Pinned: the composition is the thing being judged, and it must not scroll
 * away under the block that changes it. */
.acp .markup-context-rail__stage {
  display: flex;
  justify-content: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.acp .markup-context-rail__stage .portrait-composition {
  width: min(100%, 116px);
}
/* A 340px column has no room for a three-across card: the title wrapped to four
 * lines and pushed everything below it out of sight. */
.acp .markup-context-rail .template-applied {
  grid-template-columns: 22px minmax(0, 1fr);
}
.acp .markup-context-rail .template-applied > .button {
  grid-column: 2;
  justify-self: start;
}
/* The one prominent action of the screen, in a narrow rail: the hint above it
 * rather than beside it, and the button the full width it needs. */
.acp .markup-context-rail .inspector__footer {
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.acp .markup-context-rail .footer-hint {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
/* Выбор звука стоит рядом с галочкой знака, но это поле со списком, а не
 * галочка. На `flex-start` его ширину задаёт самый длинный вариант — сейчас
 * «Без музыки (только речь)», — а подсказка под ним (audioSourceHint) длиннее
 * любого варианта и в колонке 340px упирается в край. Растягивается на всю
 * ширину, как кнопка под ним. */
.acp .markup-context-rail .footer-hint .field {
  align-self: stretch;
}
/* Ползунок громкости фоновой музыки — та же разметка, что у ползунков шаблона
 * (`template-range`), и та же причина, что у поля выше: на `flex-start` его
 * ширину задала бы подпись, и ползунок вышел бы в палец длиной. */
.acp .markup-context-rail .footer-hint .template-range {
  align-self: stretch;
}
.acp .markup-context-rail .inspector__footer .button--primary {
  min-width: 0;
  justify-content: center;
}
.acp .markup-context-rail__scroll {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 10px 12px 12px;
}
.acp .markup-context-rail__hook {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* Narrow column: the listen and remove buttons get their own row rather than
 * squeezing the name of the sound to nothing. */
.acp .markup-context-rail .insert-row--sound {
  grid-template-columns: minmax(0, 1fr);
}
.acp .markup-context-rail .insert-row--sound {
  gap: 6px;
  padding: 6px 7px;
}
.acp .markup-context-rail .insert-row__actions {
  justify-content: flex-start;
}
/* Three named buttons in a 260px row: the icons are what pushed «Убрать» onto
 * a second line, and the words are the accessible name either way. */
.acp .markup-context-rail .insert-row__actions .button svg {
  display: none;
}
.acp .markup-context-rail .template-applied {
  align-items: flex-start;
}

/* A sound row is copy plus actions; the b-roll grid it borrowed has a poster
 * column it never fills, which squeezed the title and wrapped the buttons. */
.acp .insert-row--sound {
  grid-template-columns: minmax(0, 1fr) auto;
}
.acp .insert-row__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

@media (max-width: 1440px) {
  .acp .master-detail--markup {
    grid-template-columns: clamp(220px, 18vw, 260px) minmax(480px, 1fr) clamp(300px, 24vw, 340px);
  }
}
/* Below this the three columns stop fitting. The queue moves above the work
 * instead of squeezing the player, and stays visible rather than hiding. */
@media (max-width: 1180px) {
  .acp .master-detail--markup {
    grid-template-columns: minmax(0, 1fr) clamp(300px, 32vw, 340px);
  }
  .acp .master-detail--markup > .queue-panel--markup {
    max-height: 200px;
    grid-column: 1 / -1;
    border-radius: 9px;
  }
  /* The queue is above the work now, so the picture has to give up the height
   * it costs — the navigator and the tabs under it are not optional. */
  .acp .markup-media-stage .frame-marker__surface {
    width: min(100%, 46vh);
    max-height: 46vh;
  }
  .acp .master-detail--markup > .markup-wide {
    grid-column: 1 / -1;
  }
}
@media (max-width: 900px) {
  .acp .master-detail--markup {
    grid-template-columns: minmax(0, 1fr);
  }
  .acp .master-detail--markup > .queue-panel--markup,
.acp .master-detail--markup > .markup-wide {
    grid-column: auto;
  }
  .acp .markup-workbench,
.acp .markup-context-rail {
    overflow: visible;
  }
  .acp .markup-workbench {
    grid-template-rows: auto;
  }
  .acp .markup-media-stage .frame-marker__surface {
    width: 100%;
    max-height: 60vh;
  }
  .acp .inspector__body--markup {
    grid-template-rows: auto auto;
    overflow: visible;
  }
}

/* --- Публикация ---------------------------------------------------------- */
/* The release cabinet reuses the review inspector's two-column grid: the file
   on the left, everything said about it on the right. Only the caption block is
   new, because it is the one thing on the page that has to be shown verbatim. */
.acp .release-facts {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
}
.acp .release-settings {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}
.acp .caption-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1219;
}
.acp .caption-preview__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.acp .caption-preview__head h3 {
  font-size: 13px;
}
.acp .caption-preview__meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
/* The counter sits beside the state instead of hanging off a field. */
.acp .caption-preview__meta .character-count {
  align-self: baseline;
  margin-top: 0;
}
/* Wrapped rather than scrolled sideways, and in the page font rather than a
   monospace one: this is the text as TikTok will show it, and a preview in
   another face is a preview of something else. The line breaks are the
   caption's own, so they are preserved exactly. */
.acp .caption-preview__text {
  min-height: 64px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* A panel body's own children each bring their padding; a bare paragraph does
   not, and a hint flush against the panel edge reads as a layout bug. */
.acp .release-panel-note {
  padding: 0 16px 14px;
  color: var(--text-secondary);
  font-size: 11px;
}

.acp .master-detail--release {
  grid-template-columns: clamp(300px, 26%, 360px) minmax(0, 1fr);
}
/* A hint is a hint: at body size it competes with the caption it explains. */
.acp .release-hint {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.5;
}

/* Подключение аккаунта к TikTok: состояние и две кнопки под ним. Колонка узкая,
   поэтому всё складывается в столбик, а не растягивает таблицу. */
.acp .account-connection {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.acp .account-connection span {
  font-size: 9px;
}

/* --- Аналитика ---------------------------------------------------------------
   Экран «Аналитика» по дизайну AN1 (прогон 2026-10-29-evelone-gensyxa, в истории
   git), классы `an-*`. Новых токенов нет: только комбинации
   переменных визуальной системы.

   Один словарь цвета на весь экран, и цвет никогда не говорит один — рядом
   всегда слово или число: зелёный (--success) — лучше обычного / жив,
   красный (--danger) — хуже / в тени, жёлтый (--warning) — на грани, светло-
   серый (--text-secondary) — как обычно, тёмно-серый (--text-disabled) — мало
   данных. Мятный (--accent) — только выбор: результат им не красится, иначе
   «я выбрал» и «стало лучше» сольются.

   SVG-текст рисуется `fill: currentColor`, поэтому те же классы тона красят и
   HTML, и подписи графиков. Строковый style в разметке запрещает CSP: всё,
   что зависит от данных (задержка проявления, ширина полосы «Для вас»,
   место подсказки), приходит CSS-переменной или свойством из CSSOM.

   Шрифт не мельче 11 px нигде на экране (AN1, «Проверка», п. 3). */

/* Раскладка решает по ширине страницы, а не окна: свёрнутый сайдбар даёт
   странице ту же ширину, что окно на 148 px шире. */
.acp .page--analytics {
  container: anpage / inline-size;
}
/* LoadingBlock и ErrorBlock mountPage под шапкой первой загрузки
   (analytics.js, mount): корень mountPage здесь — блок, а не страница во всю
   высоту, и без своей высоты полоса загрузки сжималась в строку под рамкой. */
.acp .an-root > .empty-inspector {
  min-height: 320px;
  border: 0;
}
.acp .an-page {
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.acp .an-stack {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
}
.acp .an-page > .notice {
  margin-bottom: 12px;
}
.acp .an-row2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

/* Тон значения */
.acp .an-up { color: var(--success); }
.acp .an-down { color: var(--danger); }
.acp .an-warn { color: var(--warning); }
.acp .an-flat { color: var(--text-secondary); }
.acp .an-thin { color: var(--text-disabled); }
.acp .an-strong { color: var(--text); }

/* Тулбар: период и возраст слева, фильтры справа. */
.acp .page--analytics .page-toolbar {
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 8px;
  row-gap: 8px;
}
/* Узко визуальная система ставит действия тулбара в столбик на всю ширину
   (≤ 680 px окна). Здесь так нельзя: переключатель растянулся бы в полосу, а
   подпись отъехала от него. Период и возраст — первой строкой, фильтры —
   второй (AN1, «≤ 600 px»). */
.acp .an-toolbar .toolbar-actions {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}
.acp .an-toolbar .toolbar-actions > * {
  width: auto;
}
.acp .an-toolbar__label {
  color: var(--text-secondary);
  font-size: 12px;
}
.acp .an-toolbar__label + .an-chips + .an-toolbar__label {
  margin-left: 8px;
}
.acp .an-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}
.acp .an-field select {
  max-width: 170px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}
.acp .an-field select:hover {
  border-color: var(--line-strong);
}

/* Переключатель: период, возраст, срез C, корзина D. Не `.segmented` с
   кнопкой primary: три мятные заливки в одной строке перетянули бы взгляд с
   ответов (AN1, «Из визуальной системы»). */
.acp .an-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
}
.acp .an-chips button {
  padding: 4px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.acp .an-chips button:hover:not(:disabled) {
  color: var(--text);
}
.acp .an-chips button.is-on {
  background: var(--surface-raised);
  color: var(--text);
}
.acp .an-chips button:disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
}

/* Строка охвата: что посчитано и что не вошло. */
.acp .an-scope {
  margin: -4px 0 12px;
  color: var(--text-subtle);
  font-size: 12px;
  line-height: 17px;
}
.acp .an-scope b {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Блок: вопрос и ответ одной фразой. `.panel__header p` — 12 px приглушённым,
   а это главный текст блока. */
/* styles.css (старый интерфейс) даёт `.panel:not(.side-panel)` отступ 1rem —
   (0,3,0), выше `.acp .panel`. Блоки аналитики держат отступы сами: шапка во
   всю ширину, тело — `.an-body`. */
.acp section.panel.an-panel {
  padding: 0;
}
.acp .an-panel__header {
  align-items: flex-start;
}
.acp .an-panel__copy {
  min-width: 0;
}
.acp .an-verdict {
  margin-top: 3px;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 19px;
}
.acp .an-verdict b {
  font-weight: 600;
}
.acp .an-verdict .an-muted {
  color: var(--text-secondary);
}
.acp .an-hint {
  max-width: 300px;
  color: var(--text-subtle);
  font-size: 11px;
  line-height: 15px;
  text-align: right;
}
.acp .an-body {
  padding: 12px 16px 14px;
}
.acp .an-foot {
  margin-top: 8px;
  color: var(--text-subtle);
  font-size: 11px;
  line-height: 16px;
}
.acp .an-right {
  text-align: right;
}

/* Расход API: строка на провайдера и назначение, две суммы справа. */
.acp .an-spend__table {
  padding-top: 6px;
}
.acp .an-spend__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 140px;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.acp .an-spend__head {
  padding-top: 0;
  border-top: 0;
  color: var(--text-subtle);
  font-size: 11px;
}
.acp .an-spend__head span:not(:first-child),
.acp .an-spend__sum {
  text-align: right;
}
.acp .an-spend__what {
  min-width: 0;
  font-weight: 500;
}
.acp .an-spend__what small,
.acp .an-spend__sum small {
  display: block;
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 400;
}
.acp .an-spend__sum {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* A. Аккаунты */
.acp .an-acc {
  display: grid;
  grid-template-columns: 112px minmax(150px, 1.2fr) repeat(4, minmax(92px, 1fr)) 200px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}
.acp .an-accounts > .an-acc:first-child {
  border-top: 0;
}
.acp .an-acc__handle {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .an-acc__handle small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 400;
  text-overflow: ellipsis;
}
.acp .an-kv {
  min-width: 0;
}
.acp .an-kv strong {
  display: block;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}
.acp .an-kv strong small {
  font-size: 12px;
  font-weight: 500;
}
.acp .an-kv span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-subtle);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* `.an-svg` ниже по файлу ставит height: auto, а ленточка на узком экране
   встаёт во всю ширину: без своей высоты она растягивалась в столбик. */
.acp .an-svg.an-ribbon {
  max-width: 220px;
  height: 34px;
}
.acp details.an-more {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.acp .an-accounts details.an-more {
  margin: 0 16px 12px;
}
.acp details.an-more summary {
  padding: 8px 10px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
}

/* Графики */
.acp .an-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.acp .an-svg--gap {
  margin-top: 10px;
}
.acp .an-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}
.acp .an-ref {
  stroke: var(--line-strong);
  stroke-dasharray: 4 3;
  stroke-width: 1;
}
.acp .an-tick {
  color: var(--text-subtle);
  fill: currentColor;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.acp .an-tick--strong {
  color: var(--text-secondary);
}
.acp .an-tick.an-up { color: var(--success); }
.acp .an-tick.an-thin { color: var(--text-disabled); }
.acp .an-label {
  fill: currentColor;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.acp .an-dot {
  cursor: pointer;
  transition: r 120ms ease;
}
.acp .an-dot:hover {
  r: 5;
}
.acp .an-dot--n { fill: var(--text-secondary); fill-opacity: 0.55; }
.acp .an-dot--flat { fill: var(--text-secondary); fill-opacity: 0.55; }
.acp .an-dot--up { fill: var(--success); }
.acp .an-dot--down { fill: var(--danger); }
.acp .an-dot--warn { fill: var(--warning); }
.acp .an-dot--thin { fill: var(--text-disabled); }
.acp .an-dot--hollow {
  fill: none;
  stroke: var(--text-subtle);
  stroke-width: 1.2;
}
/* Тысяча роликов: точки бледнее, чтобы рой читался плотностью (AN1). */
.acp .an-dot--dense.an-dot--n,
.acp .an-dot--dense.an-dot--thin {
  fill-opacity: 0.35;
}
/* Анимация 1 из 2: точки проявляются колонками — неделя это рой роликов, а
   не столбик. Только при первой отрисовке и смене периода или возраста. */
.acp .an-appear {
  animation: an-dot-in 320ms ease-out forwards;
  animation-delay: var(--d, 0ms);
  opacity: 0;
}
@keyframes an-dot-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.acp .an-med {
  stroke: var(--text);
  stroke-linecap: round;
  stroke-width: 2.5;
}
.acp .an-med--up { stroke: var(--success); }
.acp .an-med--down { stroke: var(--danger); }
.acp .an-med--thin {
  stroke: var(--text-disabled);
  stroke-dasharray: 3 3;
}
.acp .an-trend {
  fill: none;
  stroke: var(--text);
  stroke-opacity: 0.45;
  stroke-width: 1.5;
}
.acp .an-ci {
  stroke: var(--text-secondary);
  stroke-linecap: round;
  stroke-opacity: 0.28;
  stroke-width: 8;
}
.acp .an-ci--up { stroke: var(--success); }
.acp .an-ci--down { stroke: var(--danger); }
.acp .an-iqr {
  fill: rgba(152, 164, 183, 0.1);
  stroke: rgba(152, 164, 183, 0.25);
  stroke-width: 1;
}
.acp .an-band {
  fill: rgba(152, 164, 183, 0.13);
}
.acp .an-curve {
  fill: none;
  stroke: var(--text);
  stroke-linejoin: round;
  stroke-width: 2.2;
}
.acp .an-curve--thin {
  stroke: var(--text-disabled);
  stroke-dasharray: 4 3;
}
.acp .an-curve--typ {
  fill: none;
  stroke: var(--text-subtle);
  stroke-dasharray: 2 3;
  stroke-width: 1;
}
.acp .an-mark {
  fill: var(--text);
}

/* B: таблица под графиком */
/* Колонки фиксированы и ячейки переносятся: на 390 px пять недель и подпись
   строки иначе распирали бы панель вбок. */
.acp .an-weeks {
  width: 100%;
  margin-top: 6px;
  border-collapse: collapse;
  table-layout: fixed;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.acp .an-weeks th {
  padding: 5px 0;
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 400;
  text-align: center;
}
.acp .an-weeks th,
.acp .an-weeks td {
  white-space: normal;
}
.acp .an-weeks td {
  padding: 5px 0;
  border-top: 1px solid var(--line);
  text-align: center;
}
.acp .an-weeks th:first-child,
.acp .an-weeks td:first-child {
  width: 34%;
  color: var(--text-secondary);
  text-align: left;
}
.acp details.an-more .an-weeks {
  width: calc(100% - 20px);
  margin: 0 10px 8px;
}

/* C: строки групп. Строка — кнопка: группа ставится срезом D с клавиатуры. */
.acp .an-chips + .an-groups-head {
  margin-top: 12px;
}
.acp .an-groups-head,
.acp .an-group {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 84px 62px;
  align-items: center;
  gap: 10px;
}
.acp .an-groups-head {
  padding: 0 6px 4px;
  color: var(--text-subtle);
  font-size: 11px;
}
.acp .an-axis {
  position: relative;
  height: 15px;
}
.acp .an-axis__mark {
  position: absolute;
  top: 0;
  color: var(--text-subtle);
  font-size: 11px;
  line-height: 15px;
  transform: translateX(-50%);
  white-space: nowrap;
}
.acp .an-axis__mark--usual {
  color: var(--text-secondary);
}
.acp .an-axis__mark.is-first {
  transform: none;
}
.acp .an-axis__mark.is-last {
  transform: translateX(-100%);
}
.acp .an-group {
  width: 100%;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.acp .an-group:hover:not(:disabled) {
  background: var(--surface-raised);
}
.acp .an-group:disabled {
  cursor: default;
}
.acp .an-group.is-selected {
  border-color: rgba(118, 228, 181, 0.25);
  background: var(--surface-selected);
}
.acp .an-group svg {
  height: 30px;
}
.acp .an-group__name {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .an-group.is-thin .an-group__name {
  color: var(--text-secondary);
}
.acp .an-group__name small,
.acp .an-group__x small,
.acp .an-group__r small {
  display: block;
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 400;
  line-height: 14px;
  white-space: normal;
}
.acp .an-group__x {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
}
.acp .an-group__r {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* D: корзины и срез */
.acp .an-row-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.acp .an-slice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 9px;
  border: 1px solid rgba(118, 228, 181, 0.28);
  border-radius: 999px;
  background: var(--surface-selected);
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}
.acp .an-slice button {
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
}
.acp .an-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
  color: var(--text-subtle);
  font-size: 11px;
}
.acp .an-legend i {
  display: inline-block;
  width: 14px;
  margin-right: 5px;
  border-radius: 2px;
  vertical-align: middle;
}
.acp .an-legend__line {
  height: 2px;
  background: var(--text);
}
.acp .an-legend__band {
  height: 8px;
  background: rgba(152, 164, 183, 0.25);
}

/* Что разобрать руками */
.acp .an-extremes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.acp .an-extremes > div {
  min-width: 0;
  padding: 12px 16px 14px;
}
.acp .an-extremes > div + div {
  border-left: 1px solid var(--line);
}
.acp .an-post {
  display: grid;
  width: 100%;
  grid-template-columns: 34px minmax(0, 1fr) 112px;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.acp .an-post:hover {
  background: var(--surface-raised);
}
.acp .an-post__copy {
  min-width: 0;
}
/* Превью 9:16. У рендера нет кадра-постера (маршрутов к нему нет), поэтому
   плашка с первой буквой стримера, тон — по стримеру. */
.acp .an-thumb {
  display: flex;
  width: 34px;
  height: 60px;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  border-radius: 5px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}
.acp .an-thumb--0 { background: linear-gradient(160deg, rgba(97, 211, 160, 0.28), var(--canvas)); }
.acp .an-thumb--1 { background: linear-gradient(160deg, rgba(104, 181, 255, 0.28), var(--canvas)); }
.acp .an-thumb--2 { background: linear-gradient(160deg, rgba(255, 200, 107, 0.24), var(--canvas)); }
.acp .an-post__hook {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  line-height: 17px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.acp .an-post__meta {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-subtle);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acp .an-post__x {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: right;
}
.acp .an-post__x small {
  display: block;
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
}

/* Карточка поста — в Drawer, который живёт в `main.admin-view`, вне корня
   страницы: поэтому без `.page--analytics` в селекторах. */
.acp .an-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.acp .drawer:has(.an-card) .drawer__header h2 {
  overflow-wrap: anywhere;
}
.acp .an-hero {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.acp .an-hero strong {
  flex: 0 0 auto;
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.acp .an-hero span {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
}
.acp .an-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.acp .an-facts div {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.acp .an-facts strong {
  display: block;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.acp .an-facts span {
  display: block;
  margin-top: 2px;
  color: var(--text-subtle);
  font-size: 11px;
}
.acp .an-kvlist {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
  font-size: 12px;
}
.acp .an-kvlist dt {
  color: var(--text-subtle);
}
.acp .an-kvlist dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.acp .an-sources {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--line);
}
.acp .an-sources__fy {
  display: block;
  height: 100%;
  background: var(--success);
}
.acp .an-nodata {
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--text-subtle);
  font-size: 12px;
}
.acp .an-card__stamp {
  color: var(--text-subtle);
  font-size: 11px;
}
.acp .an-card__links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-left: auto;
}
.acp .drawer__footer:has(.an-card__links) {
  justify-content: space-between;
}

/* Подсказка у точки: у курсора, 12 px. Живёт в `main.admin-view` (analytics.js,
   tipFor), не в корне страницы — тот контейнер и держал бы её position: fixed. */
.acp .an-tip {
  position: fixed;
  z-index: 80;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-raised);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 12px;
  line-height: 17px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 100ms ease;
}
.acp .an-tip.is-visible {
  opacity: 1;
}
.acp .an-tip b,
.acp .an-tip small,
.acp .an-tip span {
  display: block;
}
.acp .an-tip small {
  color: var(--text-subtle);
  font-size: 11px;
}

/* ≤ 900 px контента: пары — в колонку; строка аккаунта — в две строки:
   статус, handle и ленточка сверху, четыре числа снизу. */
@container anpage (width <= 900px) {
  .acp .page--analytics .page-toolbar {
    align-items: stretch;
  }
  .acp .an-row2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .acp .an-acc {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas:
      "status handle handle ribbon"
      "a b c d";
  }
  .acp .an-acc__status { grid-area: status; }
  .acp .an-acc__handle { grid-area: handle; }
  .acp .an-ribbon { grid-area: ribbon; }
  .acp .an-acc .an-kv:nth-of-type(3) { grid-area: a; }
  .acp .an-acc .an-kv:nth-of-type(4) { grid-area: b; }
  .acp .an-acc .an-kv:nth-of-type(5) { grid-area: c; }
  .acp .an-acc .an-kv:nth-of-type(6) { grid-area: d; }
}
/* ≤ 600 px: полоса точек C уходит под название группы, «Что разобрать» — в
   колонку, ленточка аккаунта — отдельной строкой. */
@container anpage (width <= 600px) {
  .acp .an-groups-head {
    display: none;
  }
  .acp .an-group {
    grid-template-columns: minmax(0, 1fr) 84px 62px;
    grid-template-areas:
      "name x r"
      "dots dots dots";
  }
  .acp .an-group__name { grid-area: name; }
  .acp .an-group svg { grid-area: dots; }
  .acp .an-group__x { grid-area: x; }
  .acp .an-group__r { grid-area: r; }
  .acp .an-extremes {
    grid-template-columns: minmax(0, 1fr);
  }
  .acp .an-extremes > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .acp .an-acc {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "status handle"
      "ribbon ribbon"
      "a b"
      "c d";
  }
  .acp .an-hint {
    display: none;
  }
  .acp .an-spend__row {
    grid-template-columns: minmax(0, 1fr) 96px 96px;
  }
  .acp .an-toolbar__filters .an-field select {
    max-width: 120px;
  }
}

/* Под reduced-motion здесь выключается проявление точек (анимация 1 из 2) и
   переход радиуса при наведении. Явно, а не общим правилом визуальной системы
   (`.acp *` в первом блоке prefers-reduced-motion): оно укорачивает длительность, но не задержку, и
   точки с задержкой до 640 мс стояли бы невидимыми. Анимация 2 из 2 — прежняя
   acp-drawer-in у Drawer — задержки не имеет, и её гасит то общее правило. */
@media (prefers-reduced-motion: reduce) {
  .acp .an-appear {
    animation: none;
    opacity: 1;
  }
  .acp .an-dot {
    transition: none;
  }
}
