.reestr-dash-widget {
  width: min(560px, 100%);
}

.reestr-dash-widget__open {
  appearance: none;
  background: transparent;
  color: #1e3a5f;
  border: 1px solid #8ab2e6;
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s ease;
  margin: 0;
}

.reestr-dash-widget__open:hover {
  background: rgba(138, 178, 230, .05);
  border-color: #6d9fd9;
}

.reestr-dash-widget__open svg {
  flex: 0 0 auto;
  color: #6d8eb0;
}

.reestr-dash-widget.is-open .reestr-dash-widget__open {
  margin-bottom: 10px;
}

.reestr-dash-widget__body {
  background: var(--bs-card-bg, #fff);
  border: 1px solid var(--bs-border-color);
  border-radius: 12px;
  padding: 14px 16px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.reestr-dash-widget__body[hidden] {
  display: none !important;
}

.reestr-dash-widget__hint {
  font-size: 13px;
  color: var(--bs-secondary-color);
}

.reestr-dash-widget__tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--bs-border-color);
  flex-wrap: wrap;
}

.reestr-dash-widget__tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--bs-secondary-color);
  cursor: pointer;
  position: relative;
}

.reestr-dash-widget__tab.is-active {
  color: var(--bs-body-color);
  font-weight: 500;
}

.reestr-dash-widget__tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--bs-primary);
}

.reestr-dash-widget__panel {
  display: none;
}

.reestr-dash-widget__panel.is-active {
  display: block;
}

.reestr-dash-widget__form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.reestr-dash-widget__form .form-control {
  flex: 1 1 220px;
  min-width: 0;
}

.reestr-dash-widget__meta {
  margin-top: 10px;
}

.reestr-dash-widget__resolved {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--bs-secondary-color);
  line-height: 1.35;
}

.reestr-dash-widget__resolved svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #8aa9cc;
}

.reestr-dash-widget__results {
  margin-top: 14px;
  max-height: 420px;
  overflow: auto;
}

.reestr-dash-widget__empty,
.reestr-dash-widget__error,
.reestr-dash-widget__loading {
  font-size: 13px;
  color: var(--bs-secondary-color);
  padding: 8px 0;
}

.reestr-dash-widget__error {
  color: var(--bs-danger);
}

.reestr-dash-item {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  background: var(--bs-card-bg, #fff);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  color: inherit;
  font-weight: 400;
}

.reestr-dash-item:hover {
  border-color: color-mix(in srgb, var(--bs-secondary-color) 25%, var(--bs-border-color));
  background: var(--bs-tertiary-bg, #f6f7f9);
}

.reestr-dash-item__cad {
  display: inline-block;
  font-size: 11px;
  font-weight: 400;
  color: var(--bs-secondary-color);
  border: 1px solid var(--bs-border-color);
  border-radius: 4px;
  padding: 1px 7px;
  margin-bottom: 6px;
  background: var(--bs-body-bg);
}

.reestr-dash-item__addr {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--bs-body-color);
  margin-bottom: 4px;
}

.reestr-dash-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--bs-secondary-color);
}

.reestr-dash-modal {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.reestr-dash-modal.is-open {
  display: flex;
}

.reestr-dash-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .28);
}

.reestr-dash-modal__box {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(90vh, 860px);
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.reestr-dash-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.reestr-dash-modal__head-main {
  min-width: 0;
  flex: 1 1 auto;
}

.reestr-dash-modal__head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.reestr-dash-modal__title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.reestr-dash-modal__title {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reestr-dash-modal__copy {
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--bs-secondary-color);
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}

.reestr-dash-modal__copy:hover {
  color: var(--bs-primary);
  background: color-mix(in srgb, var(--bs-primary) 10%, transparent);
}

.reestr-dash-modal__copy.is-copied {
  color: #2fb344;
  background: color-mix(in srgb, #2fb344 12%, transparent);
}

.reestr-dash-modal__copy[hidden] {
  display: none !important;
}

.reestr-dash-modal__sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--bs-secondary-color);
  line-height: 1.35;
}

.reestr-dash-modal__tech {
  appearance: none;
  border: 1px solid var(--bs-border-color);
  background: transparent;
  color: var(--bs-secondary-color);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.reestr-dash-modal__tech:hover {
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-color: color-mix(in srgb, var(--bs-primary) 35%, var(--bs-border-color));
}

.reestr-dash-widget__tab--fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  margin-left: auto;
  color: var(--bs-secondary-color);
  position: relative;
}

.reestr-dash-widget__tab--fav svg {
  display: block;
}

.reestr-dash-widget__tab--fav.is-active {
  color: var(--bs-primary);
}

.reestr-dash-widget__fav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: #f59f00;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  pointer-events: none;
}

.reestr-dash-widget__fav-badge[hidden] {
  display: none !important;
}

.reestr-dash-modal__fav {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--bs-secondary-color);
  height: auto;
  min-height: 0;
  width: auto;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  box-shadow: none;
  transition: color .15s ease, background .15s ease, border-color .15s ease, padding .15s ease;
}

.reestr-dash-modal__fav svg {
  width: 14px;
  height: 14px;
  display: block;
}

.reestr-dash-modal__fav:hover {
  color: var(--bs-primary);
  background: transparent;
  border: 0;
}

.reestr-dash-modal__fav.is-active {
  color: var(--bs-primary);
  border: 1px solid var(--bs-border-color);
  background: transparent;
  padding: 4px 8px;
  height: auto;
}

.reestr-dash-modal__fav.is-active:hover {
  background: var(--bs-body-bg);
  border-color: color-mix(in srgb, var(--bs-primary) 35%, var(--bs-border-color));
}

.reestr-dash-widget__fav-hint {
  margin-bottom: 10px;
}

.reestr-dash-item--fav {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.reestr-dash-item__main {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  cursor: pointer;
  color: inherit;
}

.reestr-dash-item__unfav {
  appearance: none;
  border: 0;
  border-left: 1px solid var(--bs-border-color);
  background: transparent;
  color: var(--bs-secondary-color);
  width: 36px;
  flex: 0 0 auto;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.reestr-dash-item__unfav:hover {
  color: var(--bs-danger);
  background: color-mix(in srgb, var(--bs-danger) 6%, transparent);
}

.reestr-dash-modal__close {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--bs-secondary-color);
  cursor: pointer;
}

.reestr-dash-modal__body {
  padding: 12px 14px;
  overflow: auto;
}

.reestr-dash-modal__toolbar {
  margin-bottom: 8px;
}

.reestr-dash-modal__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.reestr-dash-modal__field {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 6px;
  padding: 6px 8px;
}

.reestr-dash-modal__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--bs-secondary-color);
  margin-bottom: 1px;
  line-height: 1.2;
}

.reestr-dash-modal__value {
  font-size: 12px;
  color: var(--bs-body-color);
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.3;
}

.reestr-dash-modal__section {
  margin-top: 12px;
}

.reestr-dash-modal__section-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  padding-left: 8px;
  border-left: 3px solid var(--bs-primary);
}

.reestr-dash-modal__rights {
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  overflow: hidden;
}

.reestr-dash-modal__right {
  padding: 8px 10px;
  border-bottom: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.reestr-dash-modal__right:last-child {
  border-bottom: 0;
}

.reestr-dash-modal__right-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 2px;
  font-size: 12px;
  line-height: 1.35;
}

.reestr-dash-modal__right-line:last-child {
  margin-bottom: 0;
}

.reestr-dash-modal__right-label {
  width: 140px;
  flex: 0 0 auto;
  color: var(--bs-secondary-color);
  font-size: 11px;
}

.reestr-dash-modal__box--tech {
  width: min(860px, 100%);
}

.reestr-dash-tech {
  margin: 0;
  padding: 12px;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: min(70vh, 640px);
  overflow: auto;
}

.reestr-dash-tech .json-key { color: #9cdcfe; }
.reestr-dash-tech .json-string { color: #ce9178; }
.reestr-dash-tech .json-number { color: #b5cea8; }
.reestr-dash-tech .json-boolean { color: #569cd6; }
.reestr-dash-tech .json-null { color: #569cd6; }

@media (max-width: 992px) {
  .reestr-dash-modal__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .reestr-dash-modal__grid {
    grid-template-columns: 1fr;
  }

  .reestr-dash-modal__right-label {
    width: 100%;
  }

  .reestr-dash-modal__head {
    flex-direction: column;
  }

  .reestr-dash-modal__head-actions {
    width: 100%;
    justify-content: space-between;
  }
}
