.mc-library {
  display: grid;
  gap: 14px;
}

.mc-library-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.mc-library-toolbar-copy {
  min-width: 0;
}

.mc-library-toolbar h2,
.mc-library-viewer h2 {
  margin: 0;
}

.mc-library-toolbar p {
  margin: 5px 0 0;
}

.mc-library-meta,
.mc-library-document-meta,
.mc-library-count,
.mc-library-status {
  color: var(--mc-muted);
  font-size: 10px;
  line-height: 1.45;
}

.mc-library-meta {
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.mc-library-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.mc-library-browser,
.mc-library-viewer {
  min-width: 0;
}

.mc-library-browser {
  display: grid;
  gap: 12px;
  max-height: calc(100dvh - 190px);
  overflow: hidden;
}

.mc-library-search {
  display: grid;
  gap: 6px;
  color: var(--mc-muted);
  font-size: 10px;
  font-weight: 850;
}

.mc-library-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--mc-border);
  border-radius: 10px;
  padding: 0 11px;
  background: rgba(255,255,255,.04);
  color: var(--mc-text);
  font: inherit;
  font-size: 12px;
  outline: none;
}

.mc-library-search input:focus {
  border-color: rgba(94,234,212,.46);
  box-shadow: 0 0 0 3px rgba(94,234,212,.07);
}

.mc-library-file-list {
  min-height: 0;
  overflow: auto;
  padding-right: 3px;
}

.mc-library-group + .mc-library-group {
  margin-top: 15px;
}

.mc-library-group h3 {
  margin: 0 0 7px;
  color: #465d65;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mc-library-group-list {
  display: grid;
  gap: 5px;
}

.mc-library-file {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 3px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(255,255,255,.025);
  color: var(--mc-text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.mc-library-file:hover {
  background: rgba(255,255,255,.05);
}

.mc-library-file.is-active {
  border-color: rgba(94,234,212,.25);
  background: rgba(45,212,191,.09);
}

.mc-library-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 850;
}

.mc-library-file small {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #71859d;
  font-size: 9px;
}

.mc-library-file-size {
  color: #71859d;
  font-size: 9px;
  white-space: nowrap;
}

.mc-library-file-modified {
  grid-column: 1 / -1;
  min-width: 0;
  color: #465d65;
  font-size: 9px;
  line-height: 1.35;
}

.mc-library-viewer {
  min-height: calc(100dvh - 190px);
}

.mc-library-viewer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--mc-border);
}

.mc-library-viewer-head > div {
  min-width: 0;
}

.mc-library-viewer h2 {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.mc-library-document-meta {
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.mc-library-status {
  min-height: 18px;
  padding-top: 9px;
}

.mc-library-status.is-error {
  color: var(--mc-danger);
}

.mc-library-document {
  width: 100%;
  min-height: 56vh;
  max-height: calc(100dvh - 290px);
  margin: 0;
  overflow: auto;
  padding: 15px;
  border: 1px solid rgba(148,163,184,.11);
  border-radius: 12px;
  background: rgba(4,10,19,.55);
  color: #0a2231;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.6;
}

@media (max-width: 1050px) {
  .mc-library-layout {
    grid-template-columns: minmax(230px, 290px) minmax(0,1fr);
  }
}

@media (max-width: 767px) {
  .mc-library-toolbar {
    display: grid;
  }

  .mc-library-toolbar .mc-actions {
    width: 100%;
  }

  .mc-library-toolbar .mc-small-button {
    flex: 1 1 auto;
  }

  .mc-library-layout {
    grid-template-columns: 1fr;
  }

  .mc-library-browser {
    max-height: 42vh;
  }

  .mc-library-viewer {
    min-height: 0;
  }

  .mc-library-document {
    min-height: 48vh;
    max-height: none;
  }
}
