@import url("tokens.06ae1b443543.css");
@import url("layout.e67a5d96963a.css");
@import url("sidebar.be574680db2f.css");
@import url("topbar.90ef568ccd08.css");
@import url("filters.7370a1948e60.css");
@import url("table.21b8a8fdc126.css");
@import url("rightbar.6cda8d2a724e.css");
@import url("tree-sidebar.65ca777d7f7e.css");
@import url("norm_doc.db9fbd9cbf2a.css");

html,
body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

.hide {
  display: none !important;
}

.hidden-csrf-token {
  display: none !important;
}
.text-muted {
  color: var(--muted);
}
.rounded {
  border-radius: var(--r-md);
}
.shadow {
  box-shadow: var(--shadow);
}

.sidepanel .card {
  border-radius: 14px;
}
.sidepanel .card .card-body {
  padding: 14px;
}
.sidepanel .btn-apply {
  height: 36px;
  margin-top: 10px;
}

/* Custom selects */
.cselect {
  position: relative;
  width: 240px;
}
.cselect-toggle {
  height: 34px;
  width: 100%;
  border: 1px solid #7d7d7d;
  border-radius: 22px;
  background: #fff;
  padding: 0 40px 0 14px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.12),
    0 4px 10px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  min-width: 0;
  position: relative;
}

.cselect-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 4px;
}
.cselect-toggle:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 12px rgba(99, 102, 241, 0.2),
    0 0 20px rgba(99, 102, 241, 0.15);
}

.cselect-toggle:focus {
  outline: none;
  border-color: rgba(199, 210, 254, 0.6);
  box-shadow:
    0 0 0 1px rgba(199, 210, 254, 0.35),
    0 0 16px rgba(99, 102, 241, 0.18);
}
.cselect-caret {
  position: absolute;
  right: 10px;
  width: 18px;
  height: 18px;
  -webkit-mask: url("/static/test_main/img/chevron-down.f00599a07ccc.svg") no-repeat
    center/contain;
  mask: url("/static/test_main/img/chevron-down.f00599a07ccc.svg") no-repeat center/contain;
  background: #6b7280;
  transition: transform 0.18s ease;
}
.cselect[aria-expanded="true"] .cselect-caret {
  transform: rotate(180deg);
}

.cselect[aria-expanded="true"] {
  z-index: 1000;
  position: relative;
}

.cselect[aria-expanded="true"] .cselect-menu,
.cselect-menu.open {
  pointer-events: auto;
}

.cselect-menu {
  pointer-events: none;
  position: absolute;
  top: 36px;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    max-height 0.25s ease,
    opacity 0.18s ease,
    transform 0.25s ease;
  z-index: 1001;
  padding: 6px;
}

.cselect-menu::-webkit-scrollbar {
  width: 10px;
}

.cselect-menu::-webkit-scrollbar-track {
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  margin: 8px 0px;
}

.cselect-menu::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: linear-gradient(180deg, #09f4c5b2, #0098ea80);
}

.cselect-menu::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #09f4c5cc, #0098ea99);
}
/*/////////////////////////////////////////////////////*/

.cselect-menu.open {
  opacity: 1;
  transform: translateY(0);
}

.cselect-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  text-align: left;
  padding: 6px 10px;
  margin-bottom: 4px;
  background: #fff;
  border: 0;
  border-radius: 26px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  box-sizing: border-box;
}
.cselect-option:last-child {
  margin-bottom: 0;
}
.cselect-option:hover {
  background: #b3b3b32d;
}
.cselect-option-selected {
  background: linear-gradient(135deg, #b6e9ff86, #c4b1ff3a);
}
.cselect-option-selected:hover {
  background: #82cbff2d;
}

.cselect-checkbox {
  width: 18px;
  height: 18px;
  border: 1px solid #fdfdfd42;
  border-radius: 12px;
  background: #e1e1e133;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s ease;
}
.cselect-checkbox-checked {
  background: linear-gradient(
    135deg,
    #ffffff,
    #ffffff
  );
  opacity: 1;
}
.cselect-checkbox-checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 4px;
  height: 8px;
  border: solid #111827;
  border-width: 0 1.7px 1.7px 0;
}

.cselect-option-text {
  flex: 1;
  min-width: 0;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.cselect-clear-all {
  display: block;
  width: calc(100% - 8px);
  max-width: 100%;
  padding: 8px 12px;
  margin: 4px;
  background: #f3f4f6c7;
  border: 0;
  border-radius: 14px;
  color: #616b7e;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.cselect-clear-all:hover {
  background: #e5e7eb;
  color: #374151;
}

.filters .form-control {
  height: 32px;
  border-radius: 22px;
}

/* Detail panel animation */

#demand-detail {
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(6px);
  scroll-margin-top: 16px;
  transition:
    max-height 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.5s ease-out 0.1s,
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.05s;
}

#demand-detail.open {
  opacity: 1;
  transform: translateY(0);
}

.demands-detail-block-content {
  padding: 20px;
}

.demand-detail-title {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.demand-detail-id {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  flex-shrink: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #111827 0%, #000000 100%);
  color: #ffffff;
  display: inline-block;
  line-height: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.demand-detail-doc {
  font-weight: 400;
  color: #6b7280;
  margin-left: 4px;
}

.demand-detail-tags-edit {
  width: 100%;
}

.demand-detail-tags-inline {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.demand-detail-source-doc {
  margin-bottom: 12px;
}

.demand-detail-source-doc-link {
  margin-left: 6px;
}

.demand-tag-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: #e5e7eb;
  background: linear-gradient(135deg, #180556, #1d4ed8);
  white-space: nowrap;
}

.demand-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.demand-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: none;
}

.demand-badge-tech {
  background: linear-gradient(135deg, #a5cefc, #93fdea);
  font-weight: 500;
  color: #0c4a6e;
}

.demand-badge-cat {
  background: linear-gradient(135deg, #d4bbff, #a8b7f8);
  font-weight: 500;
  color: #4c1d95;
}

.demand-badge-node {
  background: linear-gradient(135deg, #fbcfe8c4, #ff8bff7f);
  font-weight: 500;
  color: #831843;
}

.demand-detail-node-view {
  margin-bottom: 10px;
}

.demand-detail-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
}
.demand-detail-tabs button {
  font-size: 13px;
}

#demand-detail .demand-detail-tabs.button-wrapper-3 {
  margin: 0 0 8px 0;
  padding: 10px 16px 0 16px;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid rgba(191, 215, 255, 0.8);
}

#demand-detail .demand-detail-tabs .btn-table-picker-active {
  background-color: #ffffff;
  color: #111827;
  font-weight: 600;
  border-radius: 999px;
  box-shadow:
    0 4px 14px rgba(79, 70, 229, 0.18),
    0 0 0 1px rgba(191, 215, 255, 0.9);
}

#demand-detail .demand-detail-tabs .btn-table-picker-inactive {
  background-color: transparent;
  color: #9ca3af;
  font-weight: 400;
  border-radius: 999px;
  box-shadow: none;
}

#demand-detail .demand-detail-tabs-container.tabs-container {
  padding: 0;
  background: transparent;
  overflow: visible;
}

#demand-detail .demand-detail-tabs-container .tabs {
  position: relative;
  z-index: 2;
  overflow: visible;
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  gap: 8px;
  background: transparent;
  padding: 0;
  min-height: 36px;
}

#demand-detail .demand-detail-tabs-container .demand-tabs-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  box-sizing: border-box;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  align-self: center;
}

#demand-detail .demand-detail-tabs-container .demand-tabs-mobile-title {
  display: none;
}

#demand-detail .demand-detail-tabs-container .tab {
  position: relative;
  flex: none;
  border: 1px solid #111;
  border-radius: 14px;
  background: transparent;
  padding: 6px 18px;
  margin: 6px 0;
  font-size: 13px;
  font-weight: 500;
  color: #0e0e0e;
  cursor: pointer;
  z-index: 1;
  transition: color 0.2s ease;
}

#demand-detail .demand-detail-tabs-container .tab:hover {
  color: #1a1a1a;
}

#demand-detail .demand-detail-tabs-container .tab[data-tab="tab2"] {
  max-width: 200px;
}

#demand-detail .demand-detail-tabs-container .tab.active {
  color: #0e0e0e;
  background: rgba(255, 255, 255, 0.95);
  border-color: transparent;
  cursor: default;
  border-radius: 14px 14px 0 0;
  margin: 0;
  overflow: visible;
}

#demand-detail .demand-detail-tabs-container .tab.active::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: -20px;
  width: 20px;
  height: 20px;
  background: transparent;
  border-bottom-right-radius: 14px;
  box-shadow: 6px 6px 0 rgba(255, 255, 255, 0.95);
  pointer-events: none;
}

#demand-detail .demand-detail-tabs-container .tab.active::after {
  content: "";
  position: absolute;
  bottom: 0px;
  right: -20px;
  width: 20px;
  height: 20px;
  background: transparent;
  border-bottom-left-radius: 14px;
  box-shadow: -6px 6px 0 rgba(255, 255, 255, 0.95);
  pointer-events: none;
}

#demand-detail .demand-detail-tabs-container .tab:not(.active) {
  padding-top: 4px;
  padding-bottom: 4px;
  border-radius: 14px 14px 14px 14px;
}

#demand-detail .demand-detail-tabs-container .tabs-content {
  position: relative;
  z-index: 1;
  touch-action: pan-y;
  min-height: 280px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.65) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--r-lg);
  overflow: hidden;
}

#demand-detail .demand-detail-tabs-container .tabs-content .content {
  display: none;
}

#demand-detail .demand-detail-tabs-container .tabs-content .content.active {
  display: block;
  animation: demandDetailFadeIn 0.2s ease;
}

/* Connections graph */
.connections-graph {
  position: relative;
  padding: 36px 24px 20px;
  min-height: 200px;
  background-color: rgba(148, 163, 184, 0.035);
  background-image: radial-gradient(
    rgba(100, 116, 139, 0.1) 1.2px,
    transparent 1.2px
  );
  background-size: 14px 14px;
  border-radius: 10px;
  margin: 16px;
  overflow-x: auto;
  overflow-y: hidden;
}

.connections-graph-header {
  position: absolute;
  top: 12px;
  right: 20px;
  z-index: 3;
}

.connections-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #94a3b8;
  background: #fff;
  color: #475569;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.connections-add-btn:hover {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}

.connections-lines {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.connections-joints {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.connections-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.2;
  filter: drop-shadow(0 0 5px rgba(100, 116, 139, 0.35));
}

.connections-joint {
  filter: drop-shadow(0 0 5px rgba(100, 116, 139, 0.4));
}

.connections-nodes {
  position: relative;
  z-index: 1;
}

/* Connections zones */
.connections-nodes--zones {
  display: grid;
  grid-template-areas:
    "zone-top   zone-top   zone-top"
    "zone-left  zone-center zone-right"
    "zone-bottom zone-bottom zone-bottom";
  grid-template-columns: max-content max-content max-content;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  min-height: 220px;
  width: max-content;
  min-width: 100%;
  align-items: start;
  justify-items: center;
  justify-content: center;
}

.connections-zone {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 8px;
  min-height: 24px;
  width: max-content;
  max-width: 100%;
}

.connections-zone--center {
  grid-area: zone-center;
  justify-content: center;
  background: transparent;
  padding: 12px;
}

.connections-zone--top {
  grid-area: zone-top;
  justify-content: center;
  flex-wrap: wrap;
  background: rgba(250, 204, 21, 0.08);
}

.connections-zone--left {
  grid-area: zone-left;
  flex-direction: column;
  align-items: flex-end;
  background: rgba(148, 163, 184, 0.1);
}

.connections-zone--right {
  grid-area: zone-right;
  flex-direction: column;
  align-items: flex-start;
  background: rgba(34, 197, 94, 0.08);
}

.connections-zone--bottom {
  grid-area: zone-bottom;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  background: rgba(56, 189, 248, 0.08);
}

.connections-nodes--zones .connection-node {
  cursor: default;
}

.connection-node {
  display: flex;
  flex-direction: column;
  min-width: 180px;
  max-width: 260px;
  padding: 10px 12px;
  padding-bottom: 30px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #7d7d7d;
  box-shadow:
    0 2px 8px rgba(15, 23, 42, 0.05),
    0 0 0 1px rgba(255, 255, 255, 0.85) inset,
    0 0 10px rgba(125, 125, 125, 0.12);
  transition: box-shadow 0.2s ease;
  cursor: grab;
  user-select: none;
  position: relative;
}

.connection-node:active {
  cursor: grabbing;
}

.connection-node:hover {
  box-shadow:
    0 4px 12px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.9) inset,
    0 0 14px rgba(125, 125, 125, 0.18);
}

.connection-node__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.connection-node__label {
  font-weight: 600;
  font-size: 13px;
  color: #111;
}

.connection-node__type {
  font-size: 11px;
  color: #6b7280;
}

.connection-node__text {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.connection-node__actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  margin-right: 22px;
}

.connection-node__unlink {
  padding: 2px 8px;
  font-size: 16px;
  line-height: 1;
}

.connection-node__expand-toggle {
  position: absolute;
  right: 8px;
  bottom: 6px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.connection-node__expand-toggle:hover {
  background: rgba(148, 163, 184, 0.16);
  color: #0f172a;
}

.connection-node__expand-icon {
  width: 12px;
  height: 12px;
  display: inline-block;
  font-size: 0;
  color: transparent;
  background: center / 12px 12px no-repeat
    url("/static/test_main/img/chevron-down.f00599a07ccc.svg");
}

.connection-node.is-expanded .connection-node__expand-toggle {
  transform: rotate(180deg);
}

.connection-node__expand-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
  font-size: 12px;
  color: #475569;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  transition:
    max-height 0.32s ease,
    opacity 0.2s ease,
    margin-top 0.32s ease,
    padding-top 0.32s ease,
    border-color 0.32s ease;
}

.connection-node.is-expanded .connection-node__expand-content {
  max-height: var(--expand-height, 260px);
  opacity: 1;
  margin-top: 8px;
  padding-top: 8px;
  border-top-color: rgba(148, 163, 184, 0.35);
}

.connection-node__expand-content a {
  color: #2563eb;
  text-decoration: underline;
}

/* Link type colors */
.connection-node:nth-child(9n + 1) {
  --conn-color: #6366f1;
}
.connection-node:nth-child(9n + 2) {
  --conn-color: #8b5cf6;
}
.connection-node:nth-child(9n + 3) {
  --conn-color: #a855f7;
}
.connection-node:nth-child(9n + 4) {
  --conn-color: #14b8a6;
}
.connection-node:nth-child(9n + 5) {
  --conn-color: #06b6d4;
}
.connection-node:nth-child(9n + 6) {
  --conn-color: #0ea5e9;
}
.connection-node:nth-child(9n + 7) {
  --conn-color: #f59e0b;
}
.connection-node:nth-child(9n + 8) {
  --conn-color: #ef4444;
}
.connection-node:nth-child(9n + 9) {
  --conn-color: #84cc16;
}

.connection-node--current {
  --conn-color: #4f46e5;
}
.connection-node--regulatory {
  --conn-color: #059669;
}
.connection-node--source {
  --conn-color: #0284c7;
}

.connections-empty {
  padding: 24px 16px;
  text-align: center;
}

.connections-grouped-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.connections-group {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
}

.connections-group__title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.connections-group__items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.connections-group__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.connections-group__main {
  min-width: 0;
}

.connections-group__label {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 3px;
}

.connections-group__text {
  font-size: 12px;
  line-height: 1.35;
  color: #475569;
}

.connections-group__link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
}

/* Add connection modal */
.connections-add-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.connections-add-modal[hidden] {
  display: none !important;
}

.connections-add-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
}

.connections-add-modal-panel {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.connections-add-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.connections-add-modal-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.connections-add-modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  border-radius: 6px;
}

.connections-add-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.connections-add-modal-body {
  padding: 16px 20px 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.connections-add-type-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connections-add-type-row label {
  font-size: 13px;
  color: #475569;
  flex-shrink: 0;
}

.connections-add-type-row .form-select {
  flex: 1;
  max-width: 200px;
}

.connections-add-search-row input {
  width: 100%;
}

.connections-add-results {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.connections-add-result-item {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.15s;
}

.connections-add-result-item:last-child {
  border-bottom: none;
}

.connections-add-result-item:hover {
  background: #e2e8f0;
}

.connections-add-result-item .item-label {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
}

.connections-add-result-item .item-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.connections-add-result-item.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.connection-node--term {
  --conn-color: #7c3aed;
}
.connection-node--tag {
  --conn-color: #0891b2;
}
.connection-node--demand {
  --conn-color: #0d9488;
}
.connection-node--linked {
  --conn-color: #2563eb;
}

@keyframes demandDetailFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  #demand-detail .demand-detail-tabs-container .tabs {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 4px;
  }

  #demand-detail .demand-detail-tabs-container .tab {
    display: none;
  }

  #demand-detail .demand-detail-tabs-container .demand-tabs-mobile-title {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
  }
}

.demand-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-style: italic;
  color: #6b7280;
  margin-bottom: 12px;
}

.demand-detail-section {
  border: 1px solid #7d7d7d;
  border-radius: 18px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #ffffff;
}

.demand-detail-section-title {
  display: block;
  margin-bottom: 4px;
}

.demand-detail-section-body {
  color: #111827;
}

.demand-detail-comments {
  color: #4b5563;
}

.demand-detail-dates {
  font-size: 0.9em;
  color: #9ca3af;
  margin-bottom: 12px;
}

/* Term card */
.term-detail-block {
  padding: 18px 20px 16px;
  box-sizing: border-box;
}

.term-detail-def-title {
  color: #6b7280bb;
}

.term-detail-source-doc,
.term-detail-dates {
  padding-left: 16px;
  padding-right: 16px;
}

.demand-detail-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: 0.35s ease;
  backdrop-filter: blur(14px);
  border: 1px solid #7d7d7d;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  margin-left: auto;
}

.btn-detail-edit,
.btn-detail-delete,
.btn-detail-save,
.btn-detail-cancel {
  min-width: 0;
  height: auto;
  padding: 8px 18px !important;
  border-radius: 999px !important;
  border: none !important;
  background: transparent !important;
  font-size: 13px;
  color: #1f2937;
  box-shadow: none;
  transition: all 0.25s ease;
}

.btn-detail-edit::before,
.btn-detail-delete::before,
.btn-detail-save::before,
.btn-detail-cancel::before {
  display: none !important;
}

.btn-detail-edit:hover,
.btn-detail-delete:hover,
.btn-detail-save:hover,
.btn-detail-cancel:hover {
  transform: none;
  background: linear-gradient(
    120deg,
    rgba(99, 102, 241, 0.08),
    rgba(56, 189, 248, 0.08),
    rgba(236, 72, 153, 0.06)
  ) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35) inset,
    0 0 10px rgba(99, 102, 241, 0.18),
    0 0 18px rgba(56, 189, 248, 0.14),
    0 0 24px rgba(236, 72, 153, 0.1);
}

/* Inline edit fields */
.demand-field-edit {
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 12px;
  background: #ffffff;
  max-width: 100%;
  box-sizing: border-box;
}

#demand-text-textarea,
#demand-comments-textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

#demand-text-textarea {
  min-height: 140px;
}

#demand-comments-textarea {
  min-height: 90px;
}

.demand-field-edit:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

.demand-tags-input {
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 6px 14px;
  height: 32px;
  min-width: 220px;
}

.demand-tags-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Node search */
.demand-detail-node-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demand-detail-node-edit-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

#demand-node-search {
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 4px 12px;
  height: 28px;
  flex: 1 1 50%;
  box-sizing: border-box;
}

#demand-node-search:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#demand-node-search::placeholder {
  opacity: 0.7;
}

#demand-node-select {
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 10px;
  height: 28px;
  flex: 1 1 50%;
  box-sizing: border-box;
}

#demand-node-select:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/*//////////////////////////////////////////////////////////*/
[hidden] {
  display: none !important;
}

/* Mid panel layout */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 22vw, 320px);
  grid-template-areas:
    "filters filters"
    "table   side";
  gap: 14px;
  padding-right: 12px;
}

.filters-wrap {
  grid-area: filters;
  display: flex;
  justify-content: stretch;
  align-items: stretch;
  width: 100%;
  margin-bottom: 12px;
  padding-right: 12px;
}

.filters-toolbar > .card {
  flex: 1 1 auto;
  width: 100%;
}

.sidepanel {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mid-toggle {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  --icon-right: url("/static/test_main/img/chevron-right.4894b8875c90.svg");
  --icon-left: url("/static/test_main/img/chevron-left.4894b8875c90.svg");
  -webkit-mask: var(--icon-right) no-repeat center/18px 18px;
  mask: var(--icon-right) no-repeat center/18px 18px;
  background-color: #6b7280;
  transition: background-color 0.2s ease;
}
.mid-toggle.open {
  -webkit-mask: var(--icon-left) no-repeat center/18px 18px;
  mask: var(--icon-left) no-repeat center/18px 18px;
}
.mid-toggle:hover {
  background-color: #374151;
}
.sidepanel {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 14px;
  padding-right: 14px;
}

.content-grid.with-mid {
  grid-template-columns: 350px minmax(0, 1fr);
  grid-template-areas:
    "filters filters"
    "mid     table";
}

#rightpanel {
  transition:
    opacity 380ms ease,
    transform 420ms cubic-bezier(0.22, 0.6, 0.18, 1);
}
#rightpanel.anim-hide {
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
}
#rightpanel.anim-show {
  opacity: 1;
  transform: translateX(0);
}
.content-grid.hide-right #rightpanel {
  display: none;
}

.filters-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.req-tree-filter,
.filters-toolbar .input,
.filters-toolbar .select {
  flex: 1 1 auto;
  min-width: 0;
}

.main-row {
  display: flex;
  align-items: stretch;
  min-width: 0;
  gap: 14px;
}

.table-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 768px) {
  .main-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .midpanel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    margin-right: 0 !important;
    margin-bottom: 1px;
    flex: 0 0 auto !important;
  }

  .table-wrap {
    width: 100%;
    flex: 0 0 auto !important;
  }

  #demand-detail {
    margin-bottom: 16px;
  }
}

#rightpanel {
  flex: 0 0 clamp(220px, 22vw, 320px);
  max-width: clamp(220px, 22vw, 320px);
  transition:
    flex-basis 0.7s cubic-bezier(0.22, 0.6, 0.18, 1),
    max-width 0.7s cubic-bezier(0.22, 0.6, 0.18, 1),
    opacity 0.4s ease,
    transform 0.7s cubic-bezier(0.22, 0.6, 0.18, 1);
}

.midpanel {
  flex: 0 0 330px;
  min-width: 330px;
  max-width: 330px;
  margin-right: 14px;
  height: auto;
  align-self: stretch;
  opacity: 1;
  transform: translateX(0);
  overflow: visible;
  border-radius: 14px;
  position: relative;
}

@media (min-width: 769px) {
  .midpanel .card-tree {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    box-sizing: border-box;
  }

  .midpanel .card-tree > div,
  .midpanel .req-tree-panel {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: none;
  }

  .midpanel .req-tree-panel {
    overflow: auto;
    overflow-x: hidden;
  }
}

@media (min-width: 769px) {
  .midpanel {
    transition:
      flex-basis 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      min-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      margin-right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .midpanel.collapsed {
    flex: 0 0 24px;
    min-width: 24px;
    max-width: 24px;
    margin-right: 0;
    overflow: hidden;
  }

  .midpanel.collapsed .card-tree,
  .midpanel.collapsed .tree-header-mobile {
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    max-height: 0;
    padding: 0;
    transition:
      opacity 0.3s ease,
      max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .midpanel:not(.collapsed) .card-tree,
  .midpanel:not(.collapsed) .tree-header-mobile {
    opacity: 1;
    pointer-events: auto;
    transition:
      opacity 0.3s ease 0.1s,
      max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .midpanel-toggle {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 60px;
    background: #ffffff00;
    border: 0px solid var(--line, #ffffff00);
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    padding: 0;
  }

  .midpanel-toggle:hover {
    background: #ffffff00;
    border: 0px solid var(--line, #ffffff00);
  }

  .midpanel-toggle-icon {
    width: 16px;
    height: 16px;
    display: block;
    fill: #09f4c5;
    transform: rotate(180deg);
    transition:
      transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      filter 0.3s ease;
  }

  .midpanel-toggle:hover .midpanel-toggle-icon {
    fill: #00d9b8;
    filter: drop-shadow(0 0 6px rgba(9, 244, 197, 0.8))
      drop-shadow(0 0 12px rgba(9, 244, 197, 0.5));
  }

  .midpanel.collapsed .midpanel-toggle-icon {
    transform: rotate(0deg);
  }

  .midpanel.collapsed .midpanel-toggle {
    right: 0;
    border-radius: 12px;
  }
}

.tree-header-mobile {
  display: none;
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
  font-size: 14px;
  border-radius: 14px 14px 0 0;
}

.tree-header-mobile .tree-toggle-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  fill: #09f4c5;
  transition:
    transform 0.3s ease,
    filter 0.3s ease;
  transform: rotate(90deg);
}

.tree-header-mobile:hover .tree-toggle-icon {
  fill: #00d9b8;
  filter: drop-shadow(0 0 4px rgba(9, 244, 197, 0.6))
    drop-shadow(0 0 8px rgba(9, 244, 197, 0.4));
}

.tree-header-mobile.collapsed .tree-toggle-icon {
  transform: rotate(0deg);
}

@media (max-width: 768px) {
  .midpanel {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .midpanel-toggle {
    display: none !important;
  }

  .midpanel.collapsed {
    flex: 0 0 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
  }

  .midpanel.collapsed .tree-header-mobile {
    opacity: 1 !important;
    pointer-events: auto !important;
    max-height: none !important;
  }

  .midpanel.collapsed .card-tree {
    opacity: 0 !important;
    pointer-events: none !important;
    max-height: 0 !important;
    padding: 0 !important;
  }

  .tree-header-mobile {
    display: flex;
  }

  .card-tree {
    overflow: hidden;
    transition:
      max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0 !important;
    padding: 0 !important;
  }

  .midpanel.expanded .card-tree {
    opacity: 1 !important;
    pointer-events: auto !important;
    max-height: 3000px !important;
    padding: 6px !important;
  }

  .midpanel:not(.expanded) .card-tree {
    max-height: 0 !important;
    padding: 0 !important;
  }
}

.card-tree {
  padding: 6px;
}

.doc-demand-highlight-single {
  background-color: rgba(199, 247, 239, 0.7);
  padding: 0 1px;
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

.doc-demand-highlight-all {
  background-color: rgba(190, 237, 255, 0.7);
  padding: 0 1px;
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

.doc-search-highlight {
  background-color: rgba(212, 255, 235, 0.6);
  padding: 0 1px;
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

.doc-search-highlight.doc-search-current {
  background-color: rgba(
    174,
    255,
    243,
    0.75
  );
  font-weight: 500;
}
