/* ============================================
   Wonder — Modal Bibliothèque d'assemblages (Pro)
   ============================================ */

#modalLibrary { display: none; align-items: center; justify-content: center; }

.wt-lib-modal {
  background: #fff;
  border-radius: 20px;
  width: 94vw; max-width: 1400px; height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
  font-family: 'Inter', -apple-system, sans-serif;
  overflow: hidden;
}

/* Header */
.wt-lib-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid #e8eae6;
  background: #fff; flex-shrink: 0;
}
.wt-lib-hd-title {
  font-size: 17px; font-weight: 700; color: #0e1411;
  letter-spacing: -.3px;
  display: flex; align-items: center; gap: 10px;
}
.wt-lib-star { color: #14543a; }
.wt-lib-close {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: transparent; cursor: pointer; font-size: 20px; color: #6b7565;
  transition: background .15s, color .15s;
  display: flex; align-items: center; justify-content: center;
}
.wt-lib-close:hover { background: #f6f6f3; color: #0e1411; }

/* Body: 2-col */
.wt-lib-bd {
  flex: 1;
  display: grid;
  grid-template-columns: 380px 1fr;
  overflow: hidden;
}

/* Left pane */
.wt-lib-listpane {
  display: flex; flex-direction: column;
  border-right: 1px solid #e8eae6;
  background: #f6f6f3;
  overflow: hidden;
  padding: 14px 12px;
  gap: 10px;
}
.wt-lib-search {
  padding: 9px 14px;
  border: 1.5px solid #e8eae6;
  border-radius: 10px;
  font-size: 13px; font-family: 'Inter', sans-serif;
  background: #fff; color: #0e1411;
  outline: none; transition: border-color .15s, box-shadow .15s;
  flex-shrink: 0;
  width: 100%; box-sizing: border-box;
}
.wt-lib-search:focus { border-color: #14543a; box-shadow: 0 0 0 3px #e7efe9; }

.wt-lib-cats {
  display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0;
}
.wt-lib-catc {
  padding: 4px 12px; border-radius: 99px;
  border: 1.5px solid #e8eae6; background: #fff;
  font-size: 11px; font-weight: 600; color: #6b7565;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all .15s;
}
.wt-lib-catc.on { background: #0e1411; color: #fff; border-color: #0e1411; }
.wt-lib-catc:hover:not(.on) { background: #eef0ec; }

.wt-lib-list {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}

/* Right pane */
.wt-lib-detail {
  display: flex; flex-direction: column;
  gap: 12px; overflow-y: auto;
  padding: 16px;
  background: #f6f6f3;
}

/* Cards */
.wt-lib-card {
  background: #fff;
  border: 1px solid #e8eae6;
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
}
.wt-lib-card-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid #eef0ec;
  font-size: 13px; font-weight: 700; color: #0e1411;
  flex-shrink: 0;
}
.wt-lib-total {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px; font-weight: 700; color: #14543a;
}
.wt-lib-card-body {
  flex: 1; overflow-y: auto;
  padding: 12px 18px;
}
.wt-lib-card-qw { flex: 0 0 auto; min-height: 120px; }
.wt-lib-card-qw .wt-lib-card-hd { background: #fffbf3; border-color: #fde7c3; }
.wt-lib-qw-body { font-size: 13px; color: #555; line-height: 1.6; white-space: pre-wrap; }

/* Empty state */
.wt-lib-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; padding: 40px 20px;
  color: #6b7565; text-align: center;
}
.wt-lib-empty span { font-size: 32px; }
.wt-lib-empty p { font-size: 13px; margin: 0; }

/* Footer */
.wt-lib-ft {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  border-top: 1px solid #e8eae6;
  background: #fff; flex-shrink: 0;
}
.wt-lib-ft-left, .wt-lib-ft-right { display: flex; gap: 10px; align-items: center; }

.wt-lib-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer; transition: all .15s;
  border: 1.5px solid transparent; white-space: nowrap;
}
.wt-lib-btn-default { background: #fff; color: #0e1411; border-color: #e8eae6; }
.wt-lib-btn-default:hover { background: #f6f6f3; }
.wt-lib-btn-green { background: #14543a; color: #fff; border-color: #14543a; }
.wt-lib-btn-green:hover { background: #0d3d2a; }
.wt-lib-btn-dark { background: #0e1411; color: #fff; border-color: #0e1411; }
.wt-lib-btn-dark:hover { background: #1f2d27; }
