@import url('../../../app-assets/dsp-web/src/utils/design-system/fonts.css');
:root {
  --bg: #f5f6f8;
  --surface: #fff;
  --text: #0f172a;
  --muted: #526178;
  --border: #c4cdda;
  --line: #e3e8ef;
  --blue: #0865ff;
  --link: #0758de;
  --selected: #edf4ff;
  --warn-bg: #fff5df;
  --warn: #785000;
  --error: #b42318;
  --good: #15704a;
  --field: #fff;
  --ghost: #eef1f6;
  color-scheme: light;
}
[data-theme='dark'] {
  --bg: #131c31;
  --surface: #1c2940;
  --text: #f4f7fc;
  --muted: #b3c0d5;
  --border: #677b99;
  --line: #354762;
  --blue: #78aaff;
  --link: #a8caff;
  --selected: #203758;
  --warn-bg: #3d321e;
  --warn: #ffda85;
  --error: #ffb4ab;
  --good: #86d9b1;
  --field: #18243a;
  --ghost: #26364d;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: 100px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px/1.5 Inter,
    system-ui,
    sans-serif;
}
a {
  color: var(--link);
  text-underline-offset: 3px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.6;
}
button,
a,
input,
select,
textarea,
summary {
  outline-offset: 3px;
}
:focus-visible {
  outline: 2px solid var(--blue);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.25px;
}
h3 {
  font-size: 14px;
}
small,
.small {
  font-size: 12px;
  color: var(--muted);
}
header {
  height: 66px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
}
.brand img {
  width: 28px;
  height: 28px;
}
.tag {
  display: inline-block;
  font-size: 11px;
  line-height: 1.6;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--selected);
  color: var(--link);
}
.muted {
  color: var(--muted);
}
.cap {
  font-size: 11px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--muted);
}
.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 13px;
  border-radius: 8px;
  font-weight: 500;
  min-height: 40px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover {
  background: var(--ghost);
}
.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
[data-theme='dark'] .btn.primary {
  color: #0f172a;
}
.btn.text {
  border: 0;
  color: var(--link);
  background: transparent;
  padding: 4px 0;
  min-height: 28px;
}
.wrap {
  max-width: 1440px;
  margin: auto;
  padding: 28px 32px 50px;
}
.intro {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin: 10px 0 20px;
}
.intro p {
  margin-top: 8px;
  color: var(--muted);
}
.notice {
  background: var(--selected);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--link);
  margin-bottom: 20px;
}
.workspace {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}
.section-nav {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 5px;
}
.section-nav a {
  padding: 10px 12px;
  text-decoration: none;
  color: var(--muted);
  border-radius: 7px;
  display: flex;
  gap: 10px;
}
.section-nav a:hover,
.section-nav a[aria-current] {
  color: var(--link);
  background: var(--selected);
}
.section-nav span {
  font-variant-numeric: tabular-nums;
  color: var(--link);
}
.stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  min-width: 0;
}
.head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  min-width: 0;
  margin-bottom: 18px;
}
.field:last-child {
  margin-bottom: 0;
}
.label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  margin-bottom: 7px;
}
.optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
}
.control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--field);
  overflow: hidden;
  min-height: 44px;
}
.control:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.control:has([aria-invalid='true']) {
  border-color: var(--error);
}
input:not([type='checkbox']):not([type='radio']),
select,
textarea {
  display: block;
  min-width: 0;
  width: 100%;
  border: 0;
  background: var(--field);
  color: var(--text);
  padding: 10px 14px;
  line-height: 22px;
  outline: none;
}
input.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.unit {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
  min-width: 64px;
  background: var(--bg);
}
textarea {
  resize: vertical;
}
.helper {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.55;
}
.err {
  font-size: 12px;
  color: var(--error);
  margin-top: 6px;
}
.err:empty {
  display: none;
}
.info {
  border-radius: 8px;
  padding: 12px;
  background: var(--selected);
  color: var(--link);
  font-size: 12px;
  line-height: 1.65;
}
.warning {
  background: var(--warn-bg);
  color: var(--warn);
}
.separator {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}
details {
  margin-top: 14px;
}
summary {
  cursor: pointer;
  color: var(--link);
  font-size: 13px;
  min-height: 32px;
}
details[open] > summary {
  margin-bottom: 12px;
}
.radio-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.radio-cards label {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: start;
  gap: 8px;
  font-size: 12px;
}
.radio-cards label:has(:checked) {
  border-color: var(--blue);
  background: var(--selected);
}
input[type='radio'],
input[type='checkbox'] {
  accent-color: var(--blue);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 2px 0;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
legend {
  font-size: 13px;
  font-weight: 550;
  margin-bottom: 8px;
}
.checks {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.checks label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.chip {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--selected);
  color: var(--link);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
}
.chip button {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 16px;
  min-width: 24px;
  min-height: 24px;
}
.summary-track {
  align-self: stretch;
  min-width: 0;
}
aside {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}
.fact {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 10px 0;
  font-size: 12px;
}
.fact span:first-child {
  color: var(--muted);
}
.fact strong {
  text-align: right;
  font-weight: 550;
}
.metric {
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -1px;
  line-height: 1.2;
  margin: 10px 0 3px;
  font-variant-numeric: tabular-nums;
}
.metric-label {
  font-size: 12px;
  color: var(--muted);
}
.bar {
  height: 6px;
  background: var(--ghost);
  border-radius: 8px;
  margin: 16px 0;
}
.bar div {
  height: 100%;
  background: var(--blue);
  border-radius: 8px;
  width: 0;
}
.flow {
  display: grid;
  gap: 8px;
  font-size: 12px;
  margin: 12px 0;
}
.flow div {
  border-left: 2px solid var(--border);
  padding: 3px 0 3px 10px;
}
.flow b {
  display: block;
}
.good {
  color: var(--good);
}
.warn-text {
  color: var(--warn);
}
.status {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
  flex-shrink: 0;
}
.status[data-state='error'] .dot,
.status[data-state='conflict'] .dot {
  background: var(--error);
}
.status[data-state='dirty'] .dot {
  background: var(--warn);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.diff {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.diff-row {
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 7px;
  font-size: 12px;
}
.diff-row b {
  display: block;
  margin-bottom: 4px;
}
.diff-row del {
  color: var(--muted);
}
.diff-row ins {
  color: var(--link);
  text-decoration: none;
}
.issue {
  display: block;
  border: 0;
  background: transparent;
  padding: 6px 0;
  text-align: left;
  color: var(--error);
  font-size: 12px;
  cursor: pointer;
}
.catalog {
  margin-top: 24px;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.tile {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.tile > p:not(.err) {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 12px;
}
.control.disabled {
  opacity: 0.55;
  background: var(--bg);
}
.control.readonly {
  background: var(--bg);
}
.control.readonly input {
  background: transparent;
}
.focused {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.empty {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 12px;
  color: var(--muted);
}
.arch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.arch span {
  background: var(--ghost);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
}
.footer-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 18px;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  max-width: 600px;
  width: calc(100% - 32px);
  padding: 24px;
  max-height: 85vh;
  overflow: auto;
}
dialog::backdrop {
  background: #0f172a88;
}
dialog h2 {
  margin-bottom: 12px;
}
dialog p {
  font-size: 13px;
  margin: 10px 0;
}
dialog .diff {
  max-height: 260px;
  overflow: auto;
}
.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;
}
[hidden] {
  display: none !important;
}
.mobile-summary {
  display: none;
}
#review-section {
  grid-column: 2/4;
}
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 1150px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .section-nav {
    grid-column: 1/-1;
    position: static;
    display: flex;
    flex-wrap: wrap;
  }
  .section-nav a {
    padding: 7px 10px;
  }
  #review-section {
    grid-column: 1/-1;
  }
}
@media (max-width: 760px) {
  header {
    height: auto;
    min-height: 64px;
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .wrap {
    padding: 20px 16px;
  }
  .intro {
    display: block;
  }
  h1 {
    font-size: 25px;
  }
  .intro .actions {
    margin-top: 14px;
  }
  .workspace {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  aside {
    position: static;
    max-height: none;
    overflow: visible;
    scrollbar-gutter: auto;
  }
  .summary-track {
    grid-column: 1;
  }
  .card {
    padding: 18px;
  }
  .catalog-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }
  .mobile-summary {
    display: block;
    margin: 12px 0;
  }
  .section-nav {
    gap: 3px;
  }
  .section-nav a {
    font-size: 12px;
  }
  .row {
    gap: 12px;
  }
  .metric {
    font-size: 30px;
  }
  #review-section {
    grid-column: 1;
  }
  .head {
    gap: 8px;
  }
}
@media (max-width: 430px) {
  .row,
  .radio-cards {
    grid-template-columns: 1fr;
  }
  .actions .btn.primary {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
@media print {
  aside {
    max-height: none;
    overflow: visible;
    scrollbar-gutter: auto;
  }
  .section-nav,
  .actions,
  header button,
  .notice {
    display: none;
  }
  .workspace {
    grid-template-columns: 1fr 300px;
  }
  aside {
    position: static;
  }
  #review-section {
    grid-column: 1/-1;
  }
  .card {
    break-inside: avoid;
  }
  .wrap {
    padding: 0;
  }
  .catalog {
    break-before: page;
  }
  body {
    background: white;
  }
  html {
    color-scheme: light;
  }
}

/* Select: собственная область шеврона, нативная семантика сохранена. */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 48px;
  background-image: url('../../../components/media/assets/chevron-down.svg');
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px 20px;
  text-overflow: ellipsis;
}
[data-theme='dark'] select {
  background-image: url('../../../components/media/assets/chevron-down-dark.svg');
}
@media (forced-colors: active) {
  select {
    appearance: auto;
    background-image: none;
  }
}
