.style-library {
  margin: 18px 0 14px;
  padding: 16px;
  border: 1px solid #dce5dd;
  border-radius: 14px;
  background: #f8fbf8;
  color: #203a30;
}
.style-library h3 { margin: 0 0 10px; }
.style-library p { margin: 10px 0 0; overflow-wrap: anywhere; }
.style-options { display: flex; flex-wrap: wrap; gap: 8px; }
.style-options .btn[aria-pressed="true"] {
  background: #e1efe6;
  color: #183e2f;
  border-color: #749882;
}
[data-style-chooser] { margin-top: 14px; }
.style-library fieldset { margin: 10px 0 0; border: 0; padding: 0; min-width: 0; }
.style-library legend { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; position: absolute; }
.style-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.style-card { overflow: hidden; border: 1px solid #dce5dd; border-radius: 10px; background: #fff; }
.style-card:has(input:checked) { outline: 2px solid #468366; outline-offset: -2px; }
.style-clip { aspect-ratio: 5 / 4; background: #16332d; position: relative; }
.style-clip video, .style-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.style-library [hidden] { display: none; }
.style-preview { display: block; position: absolute; inset: 0; padding: 0; border: 0; background: transparent; cursor: pointer; width: 100%; }
.style-preview span {
  position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 30px; height: 30px;
  border: 1px solid #ffffff70; border-radius: 50%; background: #122421d9; color: white; font-size: 12px;
}
.style-preview.playing span { opacity: 0; }
.style-card-options { display: flex; align-items: stretch; justify-content: space-between; }
.style-card label { display: flex; gap: 6px; align-items: center; padding: 8px; font-size: 13px; cursor: pointer; flex: 1; }
.style-library input[type="checkbox"] { accent-color: #397c59; flex: 0 0 auto; width: 15px; height: 15px; margin: 0; padding: 0; }
.style-expand {
  display: grid; place-items: center; min-width: 38px; min-height: 40px; padding: 0;
  background: transparent; color: #2b5242; border: 0; cursor: pointer;
}
.style-preview:focus-visible, .style-expand:focus-visible { outline: 2px solid #488366; outline-offset: -3px; }
.style-library .style-choice-note { margin: 0 0 8px; color: #426255; font-size: 13px; }
.style-confirmation { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 14px; }
.style-library .style-confirmation p { margin: 0; font-size: 13px; color: #426255; }
.style-confirmation p.confirmed { color: #236344; font-weight: 600; }
.style-library .style-dialog {
  width: min(94vw, 640px, calc(104dvh - 95px)); max-width: none; max-height: 96dvh; box-sizing: border-box;
  border: 1px solid #dce5dd; background: #f8fbf8; color: #203a30; padding: 12px; border-radius: 14px;
}
.style-dialog::backdrop { background: #0b1e19aa; }
.style-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.style-dialog-head h4 { margin: 0; }
.style-dialog .style-clip { overflow: hidden; border-radius: 8px; }
@media (max-width: 600px) {
  .style-library { padding: 12px; }
  .style-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .style-options .btn { min-height: 36px; }
}
