.ra-lib {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.ra-lib-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.ra-lib-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.ra-lib-toolbar__left {
  min-width: 0;
  flex: 1;
}

.ra-lib-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid var(--ra-stroke);
}

.ra-lib-tab {
  appearance: none;
  border: 1px solid var(--ra-stroke);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ra-text-2);
  border-radius: 14px;
  min-height: 46px;
  padding: 0 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    transform .14s ease,
    border-color .14s ease,
    background .14s ease,
    color .14s ease;
}

.ra-lib-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(78, 164, 214, 0.34);
  color: var(--ra-text-1);
}

.ra-lib-tab.is-active {
  background: rgba(78, 164, 214, 0.16);
  border-color: rgba(78, 164, 214, 0.42);
  color: var(--ra-text-1);
}

.ra-lib-toolbar__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 12px;
}

.ra-lib-toolbar__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--ra-text-1);
}

.ra-lib-toolbar__subtitle {
  margin: 6px 0 0;
  color: var(--ra-text-2);
  font-size: 14px;
  line-height: 1.45;
}

.ra-lib-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(78, 164, 214, 0.24);
  background: rgba(78, 164, 214, 0.12);
  color: var(--ra-text-1);
  font-size: 12px;
  font-weight: 800;
}

.ra-lib-toolbar__right {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.ra-lib-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ra-lib-state {
  border: 1px dashed var(--ra-stroke);
  border-radius: 18px;
  padding: 20px 18px;
  background: rgba(255, 255, 255, 0.02);
}

.ra-lib-state__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ra-text-1);
}

.ra-lib-state__text {
  margin-top: 6px;
  color: var(--ra-text-2);
  font-size: 14px;
  line-height: 1.5;
}

.ra-lib-table-wrap {
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--ra-stroke);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.ra-lib-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.ra-lib-table thead th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ra-stroke);
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ra-text-3);
  background: rgba(16, 32, 58, 0.92);
}

.ra-lib-table tbody td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
  font-size: 13px;
  color: var(--ra-text-1);
}

.ra-lib-table tbody tr:last-child td {
  border-bottom: none;
}

.ra-lib-row--clickable {
  cursor: pointer;
  transition: background .12s ease;
}

.ra-lib-row--clickable:hover td {
  background: rgba(78, 164, 214, 0.06);
}

.ra-lib-cell-muted {
  color: var(--ra-text-2);
}

.ra-lib-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--ra-text-2);
  word-break: break-word;
}

.ra-lib-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--ra-stroke);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ra-lib-status.is-active {
  background: rgba(78, 164, 214, 0.14);
  border-color: rgba(78, 164, 214, 0.34);
  color: var(--ra-text-1);
}

.ra-lib-status.is-archived {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ra-text-2);
}

.ra-lib-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ra-lib-action {
  appearance: none;
  border: 1px solid var(--ra-stroke);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ra-text-1);
  border-radius: 10px;
  min-height: 32px;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}

.ra-lib-action:hover {
  transform: translateY(-1px);
  border-color: rgba(78, 164, 214, 0.34);
}

.ra-lib-action.is-danger {
  color: #ffd0d0;
}

.ra-lib-action[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.ra-lib-status.is-medium {
  background: rgba(200, 160, 60, 0.14);
  border-color: rgba(200, 160, 60, 0.34);
  color: #e8c96a;
}

.ra-lib-dl {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ra-lib-dl__row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ra-lib-dl__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ra-text-3);
}

.ra-lib-dl__value {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ra-text-1);
}

.ra-lib-slideover__stub {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  border: 1px dashed var(--ra-stroke);
  border-radius: 14px;
  color: var(--ra-text-3);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 24px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1200px) {
  .ra-lib-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ra-lib-toolbar__right {
    align-items: stretch;
  }

  .ra-lib-tabs {
    padding-left: 0;
    border-left: 0;
    padding-top: 12px;
    border-top: 1px solid var(--ra-stroke);
  }
}

@media (max-width: 900px) {
  .ra-lib-table {
    min-width: 600px;
  }
}
