@scope (#coachImportedBuilder) {
:where(button) {background:transparent;border:0;color:inherit;}
:where(button:disabled) {opacity:.4;cursor:default;}
/* Library Sessions — OLED, same tokens as Training */
.shell-screen--library {
  min-height: 100dvh;
  background: var(--oled-bg);
  padding-bottom: calc(var(--fab-size) + 48px);
}

.lib-top {
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 8px;
}

.lib-kicker {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oled-muted);
  margin: 0 0 4px;
}

.lib-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.lib-head-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 8px;
}

.lib-head-row h1 {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
  flex: 1;
}

.lib-back, .lib-text-btn {
  min-height: var(--tap);
  padding: 0 8px;
  color: var(--trn-blue);
  font-weight: 600;
  font-size: 15px;
}

.lib-search {
  margin: 0 16px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--oled-surface);
  border: 1px solid var(--oled-line);
  border-radius: 12px;
  padding: 0 12px;
  min-height: 44px;
}

.lib-search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  min-width: 0;
}

.lib-create {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--oled-surface);
  border: 1px solid var(--oled-line);
  text-align: left;
  font-weight: 600;
}

.lib-plus {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--trn-blue);
  color: var(--trn-blue);
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  flex: none;
}

.lib-empty {
  text-align: center;
  color: var(--oled-muted);
  padding: 28px 24px;
  font-size: 14px;
}

.lib-card {
  margin: 0 16px 12px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: var(--oled-surface);
  border: 1px solid var(--oled-line);
}

.lib-card h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.lib-card p {
  margin: 0;
  color: var(--oled-muted);
  font-size: 13px;
  line-height: 1.4;
}

.lib-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.lib-chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: #1ba3ff22;
  color: var(--trn-blue);
  font-weight: 600;
  font-size: 13px;
}

.lib-danger {
  color: #ff6b6b;
  min-height: 36px;
  padding: 0 8px;
  font-size: 13px;
}

.lib-field {
  margin: 0 16px 14px;
}

.lib-field label {
  display: block;
  font-size: 12px;
  color: var(--oled-muted);
  margin-bottom: 6px;
}

.lib-field input, .lib-field textarea, .lib-field select {
  width: 100%;
  background: var(--oled-surface);
  border: 1px solid var(--oled-line);
  border-radius: 10px;
  padding: 12px;
  outline: none;
}

.lib-field textarea { min-height: 88px; resize: vertical; }

.lib-block {
  margin: 0 16px 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--oled-surface);
  border: 1px solid var(--oled-line);
}

.lib-block-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.lib-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--trn-letter-bg);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}

.lib-block h3 { margin: 0; font-size: 16px; }
.lib-block .meta { color: var(--trn-blue); font-size: 13px; font-weight: 600; }

.lib-ss {
  text-align: center;
  color: var(--trn-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 4px 16px;
  border: 1px solid var(--trn-blue);
  border-radius: 999px;
  padding: 4px;
}

.lib-wizard-next {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: var(--nav-h);
  width: min(100%, 430px);
  margin: 0;
  padding: 10px 16px 14px;
  background: #000;
  z-index: 16;
  box-sizing: border-box;
}
.shell-screen--library:has(.lib-wizard-next) {
  padding-bottom: calc(var(--nav-h) + 88px);
}

.lib-row-btns {
  display: flex;
  gap: 12px;
  margin: 8px 16px calc(var(--fab-size) + 24px);
}

.lib-row-btns button {
  flex: 1;
  min-height: 48px;
  border-radius: 999px;
  border: 1.5px solid var(--trn-blue);
  color: var(--trn-blue);
  font-weight: 600;
}

.lib-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-bottom: 1px solid var(--oled-line);
  text-align: left;
}

.lib-pick-row b { flex: 1; font-weight: 600; }

.lib-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--trn-blue);
  flex: none;
}

.lib-radio.on {
  background: var(--trn-blue);
  box-shadow: inset 0 0 0 4px #000;
}

.lib-tabs {
  display: flex;
  gap: 18px;
  padding: 0 16px 8px;
  border-bottom: 1px solid var(--oled-line);
  margin-bottom: 8px;
}

.lib-tabs button {
  padding: 10px 0;
  color: var(--oled-muted);
  font-weight: 600;
}

.lib-tabs button.on {
  color: var(--trn-blue);
  box-shadow: inset 0 -2px 0 var(--trn-blue);
}

.lib-sheet {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 40;
  display: flex;
  align-items: flex-end;
}

.lib-sheet-card {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  background: #1c1c1e;
  border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom, 0px));
}

.lib-sheet-card h2 {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.lib-primary {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  background: var(--trn-blue);
  color: #fff;
  font-weight: 700;
  margin-top: 8px;
}

.lib-primary:disabled { opacity: 0.4; }

.lib-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bottom-nav button[data-tab="library"].active svg {
  color: var(--trn-blue);
  fill: var(--trn-blue);
}

.lib-ex { padding: 8px 16px 18px; }
.lib-ex-top { display: flex; align-items: center; gap: 10px; }
.lib-ex-top h3 { margin: 0; font-size: 28px; font-weight: 700; flex: 1; }
.lib-done { min-height: 36px; padding: 0 14px; border: 1px solid #3a3a3c; border-radius: 10px; background: #1c1c1e; color: #fff; }
.lib-notes { display: block; margin: 14px 0; }
.lib-notes textarea { width: 100%; min-height: 72px; box-sizing: border-box; background: transparent; border: 1px solid #3a3a3c; border-radius: 12px; padding: 12px; color: #fff; }
.lib-metrics { margin: 0 0 14px; }
.lib-grid { display: grid; grid-template-columns: 36px 1fr 1fr; gap: 10px 12px; align-items: center; }
.lib-grid.tempo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: end; }
.lib-grid-h { color: #1ba3ff; font-weight: 650; }
.lib-grid.tempo-grid .lib-grid-h { display: grid; gap: 6px; min-width: 0; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.lib-cell { min-height: 44px; border-radius: 10px; background: #1c1c1e; color: #fff; width: 100%; box-sizing: border-box; }
.lib-grid.tempo-grid .lib-cell { text-align: center; font-size: 22px; padding: 0; }
.lib-stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 18px; }
.lib-step { width: 46px; height: 46px; border-radius: 50%; border: 2px solid #1ba3ff; background: transparent; color: #1ba3ff; font-size: 28px; line-height: 1; }
.photo-pad { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; max-width: 430px; margin: 0 auto; background: #141414; color: #fff; border-radius: 18px 18px 0 0; padding: 16px 18px calc(18px + env(safe-area-inset-bottom, 0px)); }
.photo-pad-top { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 16px; }
.photo-pad-val { font-size: 54px; font-weight: 500; letter-spacing: -1px; line-height: 1; }
.photo-caret { background: #3a3a3c; border-radius: 4px; }
.photo-pad-unit { color: #8e8e93; font-size: 18px; letter-spacing: .12em; margin-bottom: 8px; }
.photo-pad-close { margin-left: auto; background: transparent; color: #fff; font-size: 28px; width: 44px; height: 44px; }
.photo-pad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 10px; justify-items: center; }
.photo-key { width: 68px; height: 68px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.92); background: transparent; color: #fff; font-size: 28px; }
.photo-key-bs { border-radius: 16px; }

}

.lib-rounds {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  font-weight: 600;
  font-size: 15px;
}
.lib-rounds button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--oled-line, #333);
  color: var(--oled-muted, #888);
  background: none;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}
.lib-rounds b { font-variant-numeric: tabular-nums; font-weight: 600; }
