/* ---- full-viewport three-panel layout ---- */
#v-library:not(.hide) { height: calc(100vh - 60px); display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
@media(min-width:768px) { #v-library:not(.hide) { height: calc(100vh - 52px); } }
#v-library .brand { flex-shrink: 0; }
#lib-content { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

.lib-row { flex: 2; display: flex; flex-direction: column; min-height: 0; }
.lib-section { flex: 1; display: flex; flex-direction: column; min-height: 0; margin-bottom: 0; border-top: 1px solid var(--card-line); padding: 0; }
.lib-row .lib-section:first-child { border-top: none; }
.lib-section:first-child { border-top: none; }
@media(min-width:768px) {
  .lib-row { flex-direction: row; }
  .lib-row .lib-section:first-child { padding-right: 16px; }
  .lib-row .lib-section:last-child { border-top: none; border-left: 1px solid var(--card-line); padding-left: 16px; }
}

.lib-head { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; padding: 12px 0 10px; margin-bottom: 0; gap: 10px; }
.lib-title { font-family: 'DM Sans', system-ui, sans-serif; font-weight: 600; font-size: 17px; }
/* + New / + Save current week buttons */
.lib-add {
  font-family: 'DM Sans', system-ui, sans-serif; font-size: 12px; font-weight: 600;
  padding: 6px 14px; border-radius: 8px; cursor: pointer; letter-spacing: .02em; flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(168,85,247,0.35);
  color: var(--purple);
  transition: border-color .22s, background .22s, color .22s, box-shadow .22s;
}
.lib-add:hover { border-color: var(--purple); background: rgba(168,85,247,0.1); color: #fff; box-shadow: 0 0 20px -6px var(--glow-purple); }
.lib-add:active { transform: scale(.97); }

.lib-search { flex: 1; min-width: 0; background: rgba(0,0,0,.22); border: 1px solid var(--card-line); border-radius: 9px; color: var(--ink); font-family: inherit; font-size: 13px; padding: 6px 10px; outline: none; transition: .18s; -webkit-appearance: none; }
.lib-search:focus { border-color: var(--purple); box-shadow: 0 0 0 2px rgba(168,85,247,.15); }
.lib-search::placeholder { color: var(--ink-faint); }

.lib-list { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 7px; padding-bottom: 10px; padding-right: 2px; }
.lib-item { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; padding: 11px 14px; flex-shrink: 0; }
.lib-badge { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; flex-shrink: 0; }
.lib-badge.lifting { background: rgba(168,85,247,.12); color: var(--purple); border: 1px solid rgba(168,85,247,.25); }
.lib-badge.cardio { background: rgba(255,181,71,.15); color: var(--amber); border: 1px solid rgba(255,181,71,.3); }
.lib-name { font-weight: 600; font-size: 13.5px; flex: 1; }
.lib-sub { font-size: 11.5px; color: var(--ink-faint); }
.lib-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Icon buttons — btn-icon-sm style */
.lib-edit {
  background: transparent; border: 1px solid rgba(168,85,247,0.2);
  color: var(--ink-faint); cursor: pointer; padding: 5px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .22s, background .22s, color .22s, box-shadow .22s;
}
.lib-edit:hover { border-color: rgba(168,85,247,0.5); background: rgba(168,85,247,0.1); color: var(--purple); box-shadow: 0 0 16px -6px var(--glow-purple); }
.lib-edit:active { transform: scale(.93); }

.lib-del {
  background: transparent; border: 1px solid rgba(248,113,113,0.2);
  color: var(--ink-faint); cursor: pointer; padding: 5px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .22s, background .22s, color .22s, box-shadow .22s;
}
.lib-del:hover { border-color: rgba(248,113,113,0.5); background: rgba(248,113,113,0.1); color: var(--rose); box-shadow: 0 0 16px -6px rgba(248,113,113,0.4); }
.lib-del:active { transform: scale(.93); }
.lib-empty { font-size: 13px; color: var(--ink-faint); font-style: italic; text-align: center; padding: 20px; }
.lib-section.compact { flex: none; }
