.keo-video-library{
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  position:relative;
  left:auto;
  transform:none;
  margin-left:0;
  margin-right:0}
.keo-video-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:24px;
  margin:24px 0}
.keo-video-card{
  min-width:0;
  border:1px solid #e5e5e5;
  border-radius:5px;
  overflow:hidden;
  background:#fff}
.keo-video-card-image{
  display:block;
  aspect-ratio:4/3;
  background:#f5f5f5}
.keo-video-card-image img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover}
.keo-video-card-body{
  padding:16px}
.keo-video-card-title{
  font-size:1.2rem;
  line-height:1.35;
  margin:0 0 8px}
.keo-video-card-title a{
  text-decoration:none}
.keo-video-card-excerpt{
  font-size:.95rem;
  line-height:1.5}
.keo-video-card-category{
  font-size:.85rem;
  opacity:.75;
  margin-top:12px}
.keo-video-card-duration{
  font-size:.85rem;
  opacity:.75;
  margin-top:5px}
.keo-lesson-nav{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin:20px 0}
.keo-lesson-link{
  padding:8px 14px;
  border:1px solid #ddd;
  text-decoration:none;
  border-radius:4px}
.keo-lesson-link.is-active{
  font-weight:700;
  border-color:currentColor}
.keo-video-pagination{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin:24px 0}
.keo-video-pagination .page-numbers{
  padding:6px 10px}
.keo-trial-details{
  margin:18px 0}
.keo-trial-summary{
  cursor:pointer}
.keo-trial-form{
  margin-top:14px}
@media(max-width:850px){
  .keo-video-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:550px){
  .keo-video-grid{
  grid-template-columns:1fr}
}

.keo-video-library.keo-library-list-mode{
  width:100%;
  max-width:100%;
  left:auto;
  transform:none;
  margin-left:0;
  margin-right:0}
.keo-lesson-link.is-active{
  color:#fff;
  background:#48664e}
.keo-library-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin:16px 0}
.keo-view-switch{
  display:flex;
  gap:4px}
.keo-view-switch a{
  padding:6px 12px;
  border:1px solid #ccc;
  border-radius:5px;
  text-decoration:none}
.keo-view-switch a.is-active{
  background:#48664e;
  color:white;
  border-color:#48664e}
.keo-video-grid.keo-video-list{
  display:block;
  margin:14px 0}
.keo-video-list .keo-video-card{
  display:block;
  border:0;
  border-bottom:1px solid #ddd;
  border-radius:0;
  background:transparent}
.keo-video-list .keo-video-card-body{
  padding:20px 2px}
.keo-video-list .keo-video-card-title{
  font-size:1.23rem;
  margin-bottom:7px}
.keo-video-list .keo-video-card-excerpt{
  max-width:80ch}
.keo-video-list .keo-video-card-category{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  opacity:1;
  margin-top:12px}
.keo-area-tag,.keo-active-areas a{
  display:inline-block;
  background:#eef1ee;
  border:1px solid #dce4dc;
  border-radius:5px;
  padding:3px 9px;
  font-size:.85rem;
  text-decoration:none}
.keo-area-tag.is-selected{
  background:#d7e4d7;
  border-color:#7c9a80}
.keo-active-areas{
  display:flex;
  gap:7px;
  align-items:center;
  flex-wrap:wrap;
  margin:12px 0;
  font-size:.9rem}
.keo-video-list .keo-video-card-duration{
  margin-top:10px}
@media(max-width:550px){
  .keo-video-list .keo-video-card-body{
  padding:16px 0}
}

.keo-library-filters{
  margin:18px 0 24px;
  padding:16px;
  border:1px solid #ddd;
  border-radius:8px;
  max-width:100%;
  box-sizing:border-box}
.keo-library-filters fieldset{
  border:0;
  padding:0;
  margin:0 0 14px;
  min-width:0}
.keo-library-filters legend{
  font-weight:600;
  margin-bottom:10px}
.keo-filter-areas{
  display:flex;
  flex-wrap:wrap;
  gap:7px}
.keo-filter-chip{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:5px 10px;
  border:1px solid #d5ded5;
  border-radius:6px;
  cursor:pointer;
  font-size:.9rem;
  line-height:1.4}
.keo-filter-chip.is-selected{
  background:#d7e4d7;
  border-color:#7c9a80}
.keo-filter-chip input{
  margin:0}
.keo-filter-options{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin:12px 0}
.keo-filter-options label{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:.9rem}
.keo-filter-options select{
  max-width:100%}
.keo-library-filters details{
  margin:12px 0}
.keo-library-filters summary{
  cursor:pointer}
.keo-library-filters details .keo-filter-areas{
  margin-top:10px}
.keo-filter-actions{
  display:flex;
  gap:15px;
  align-items:center;
  flex-wrap:wrap}
.keo-filter-actions button{
  padding:8px 16px;
  background:#48664e;
  color:#fff;
  border:0;
  border-radius:5px;
  cursor:pointer}
.keo-video-card-category{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  opacity:1}
.keo-video-library,.keo-video-library *{
  box-sizing:border-box}

@media(max-width:700px){
  .keo-library-filters{
  padding:10px 12px;
  margin:12px 0}
.keo-mobile-filter-panel>summary{
  display:list-item;
  cursor:pointer;
  font-weight:600;
  padding:8px 3px}
.keo-mobile-filter-content{
  padding-top:12px}
.keo-filter-areas{
  gap:6px}
.keo-filter-chip{
  font-size:.85rem;
  padding:5px 8px}
#keo-library-results{
  scroll-margin-top:16px}
}
@media(min-width:701px){
  /* Desktop also supports opening and closing the filters. */
  .keo-video-library .keo-mobile-filter-panel>summary{
    display:list-item;
    cursor:pointer;
    font-weight:600;
    padding:8px 3px;
  }
  .keo-video-library .keo-mobile-filter-panel[open]>.keo-mobile-filter-content{
    display:block;
    padding-top:12px;
  }
  .keo-video-library .keo-mobile-filter-panel:not([open])>.keo-mobile-filter-content{
    display:none;
  }
}

.keo-library-toolbar-controls{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap}
.keo-per-page-form{
  display:flex;
  align-items:center;
  gap:7px;
  margin:0}
.keo-per-page-form label{
  font-size:.9rem}
.keo-per-page-form select{
  width:auto;
  max-width:100%;
  padding:5px 8px}
.keo-video-card-tools{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  margin-top:10px;
  font-size:.85rem}
.keo-card-meta-label{
  opacity:.75}
.keo-tool-tag{
  display:inline-block;
  background:#eef1ee;
  border:1px solid #dce4dc;
  border-radius:5px;
  padding:3px 9px;
  text-decoration:none}
.keo-tool-tag.is-selected{
  background:#d7e4d7;
  border-color:#7c9a80}
.keo-video-list .keo-video-card-excerpt{
  line-height:1.6}
.keo-video-library .keo-video-card{
  min-width:0}
@media(max-width:550px){
  .keo-library-toolbar{
  align-items:flex-start}
.keo-library-toolbar-controls{
  width:100%;
  justify-content:space-between}
}

/* Only the presentation reacts to viewport size;
   query logic is shared. */
.keo-video-library.keo-ajax-ready .keo-filter-actions button[type="submit"]{
  display:none}

.keo-video-library.keo-is-loading .keo-library-dynamic{
  opacity:.62;
  transition:opacity .1s ease}

.keo-video-library .keo-library-dynamic{
  min-width:0;
  max-width:100%}

.keo-mobile-filter-panel .keo-filter-active-count:empty{
  display:none}

@media(max-width:700px){
  .keo-mobile-filter-panel:not([open]) .keo-mobile-filter-content{
  display:none}
}


/* 1.3.14: compact text search stays visible when the filter panel is closed. */
.keo-video-library {
  --keo-action:#48664e;
  --keo-action-hover:#395640;
  --keo-text:#294438;
  --keo-soft:#e7efe8;
}
.keo-video-library .keo-text-search { margin:0 0 14px; }
.keo-video-library .keo-text-search>label { display:block; font-size:.9rem; font-weight:600; margin:0 0 6px; }
.keo-video-library .keo-text-search-row { display:flex; gap:8px; align-items:stretch; min-width:0; }
.keo-video-library .keo-text-search input[type="search"] {
  flex:1 1 180px;
  min-width:0;
  width:100%;
  border:1px solid #aab9ae;
  border-radius:5px;
  background:#fff;
  color:var(--keo-text);
  padding:9px 12px;
  font-size:1rem;
}
.keo-video-library .keo-text-search input[type="search"]:focus-visible,
.keo-video-library .keo-library-filters select:focus-visible,
.keo-video-library .keo-view-switch a:focus-visible,
.keo-video-library .keo-filter-chip:focus-within {
  outline:2px solid var(--keo-action);
  outline-offset:2px;
}
.keo-video-library .keo-text-search-submit,
.keo-video-library .keo-filter-actions button {
  background:var(--keo-action);
  border:1px solid var(--keo-action);
  border-radius:5px;
  color:#fff !important;
  font-weight:600;
  cursor:pointer;
  padding:8px 14px;
}
.keo-video-library .keo-text-search-submit:hover,
.keo-video-library .keo-filter-actions button:hover {
  background:var(--keo-action-hover);
  border-color:var(--keo-action-hover);
  color:#fff !important;
}
.keo-video-library .keo-view-switch a,
.keo-video-library .keo-view-switch a:visited {
  display:inline-flex;
  align-items:center;
  background:#fff;
  color:var(--keo-action) !important;
  border:1px solid #aab9ae;
  border-radius:5px;
  text-decoration:none;
}
.keo-video-library .keo-view-switch a:hover { background:#f2f6f3; }
.keo-video-library .keo-view-switch a.is-active,
.keo-video-library .keo-view-switch a.is-active:visited,
.keo-video-library .keo-view-switch a.is-active:hover,
.keo-video-library .keo-view-switch a.is-active:focus {
  background:var(--keo-action);
  color:#fff !important;
  border-color:var(--keo-action);
  opacity:1;
  text-decoration:none;
}
.keo-video-library .keo-filter-chip.is-selected,
.keo-video-library .keo-area-tag.is-selected,
.keo-video-library .keo-tool-tag.is-selected {
  background:var(--keo-soft);
  border-color:#78977f;
  color:var(--keo-text) !important;
  opacity:1;
}
.keo-video-library .keo-area-tag.is-selected:visited,
.keo-video-library .keo-tool-tag.is-selected:visited { color:var(--keo-text) !important; }
.keo-video-library .keo-mobile-filter-panel>summary { color:var(--keo-text); }
.keo-video-library .keo-active-areas a { color:var(--keo-text); }
.keo-video-library .keo-active-areas a:hover { background:#e4ebe6; }
@media(max-width:550px){
  .keo-video-library .keo-text-search-row { flex-wrap:wrap; }
  .keo-video-library .keo-text-search-submit { padding:8px 12px; }
}


/* 1.3.15: Let the lessons lead. Only search and a compact filter toggle show
   initially, identically on desktop and mobile. The filter contents remain
   in the same form so the existing AJAX/query code needs no duplication. */
.keo-video-library .keo-library-filters {
  border:0;
  border-radius:0;
  padding:0;
  margin:12px 0 16px;
  background:transparent;
}
.keo-video-library .keo-visually-hidden {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
.keo-video-library .keo-text-search { margin:0 0 12px; }
.keo-video-library .keo-text-search-row { gap:8px; flex-wrap:nowrap; }
.keo-video-library .keo-text-search input[type="search"] {
  min-height:44px;
  padding:10px 14px;
}
.keo-video-library .keo-text-search-submit {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 46px;
  width:46px;
  min-height:44px;
  padding:8px!important;
  line-height:1;
}
.keo-video-library .keo-text-search-submit svg { display:block; }
.keo-video-library .keo-mobile-filter-panel { margin:0; }
.keo-video-library .keo-mobile-filter-panel>summary {
  display:inline-flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  list-style:none;
  border:1px solid #b5c3b8;
  border-radius:6px;
  padding:9px 12px;
  background:#fff;
  color:var(--keo-action);
  font-weight:600;
  line-height:1.35;
}
.keo-video-library .keo-mobile-filter-panel>summary::-webkit-details-marker { display:none; }
.keo-video-library .keo-mobile-filter-panel>summary::after {
  content:'▾';
  font-size:.92em;
  line-height:1;
  margin-left:4px;
}
.keo-video-library .keo-mobile-filter-panel[open]>summary::after { content:'▴'; }
.keo-video-library .keo-mobile-filter-panel>summary:hover { background:#f2f6f3; }
.keo-video-library .keo-mobile-filter-panel>summary:focus-visible {
  outline:2px solid var(--keo-action);
  outline-offset:3px;
}
.keo-video-library .keo-filter-active-count:not(:empty) {
  font-size:.82rem;
  font-weight:500;
  color:var(--keo-text);
  background:var(--keo-soft);
  border-radius:20px;
  padding:2px 7px;
}
.keo-video-library .keo-mobile-filter-content {
  padding:16px;
  margin-top:10px;
  background:#fff;
  border:1px solid #dce4dc;
  border-radius:8px;
}
@media(max-width:700px){
  .keo-video-library .keo-library-filters { margin:10px 0 14px; padding:0; }
  .keo-video-library .keo-mobile-filter-content { padding:12px; }
}


/* 1.3.17 — The two exclusive tool choices lead; search follows.
   Advanced options remain in the same GET form (and the same AJAX query). */
.keo-video-library .keo-library-filters { margin:12px 0 7px; }
.keo-video-library .keo-tool-selector { margin:0 0 16px; }
.keo-video-library .keo-tool-options {
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
}
.keo-video-library .keo-tool-option,
.keo-video-library .keo-tool-option:visited {
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 17px; min-height:42px;
  background:#fff; color:var(--keo-action) !important;
  border:1px solid #d1dbd3; border-radius:7px;
  text-decoration:none; font-weight:600; line-height:1.3;
  transition:background-color .15s, border-color .15s;
}
.keo-video-library .keo-tool-option:hover { border-color:#78977f; background:#f5f8f5; }
.keo-video-library .keo-tool-option.is-active,
.keo-video-library .keo-tool-option.is-active:visited,
.keo-video-library .keo-tool-option.is-active:hover {
  color:#fff !important; background:var(--keo-action); border-color:var(--keo-action);
}
.keo-video-library .keo-tool-option:focus-visible,
.keo-video-library .keo-tools-info>summary:focus-visible,
.keo-video-library .keo-area-panel>summary:focus-visible,
.keo-video-library .keo-view-toggle:focus-visible {
  outline:2px solid var(--keo-action); outline-offset:3px;
}
.keo-video-library .keo-tools-info { position:relative; margin:0; flex:0 0 auto; }
.keo-video-library .keo-tools-info>summary {
  width:26px; height:26px; padding:0; display:flex;
  align-items:center; justify-content:center; cursor:pointer;
  border:1px solid #98aa9c; color:#48664e;
  border-radius:50%; font-weight:700; font-size:.8rem; line-height:1;
  list-style:none; background:#fff;
}
.keo-video-library .keo-tools-info>summary::-webkit-details-marker { display:none; }
.keo-video-library .keo-info-link-label { display:none; }
.keo-video-library .keo-tools-info-content {
  position:absolute; top:calc(100% + 9px); right:0;
  width:min(300px, calc(100vw - 44px)); padding:13px 15px;
  z-index:20; border:1px solid #d1dbd3; border-radius:8px;
  box-shadow:0 8px 20px rgba(0,0,0,.11);
  background:#fff; font-size:.88rem; line-height:1.5;
}
.keo-video-library .keo-tools-info-content p { margin:8px 0 0; }
.keo-video-library .keo-text-search { margin:0 0 13px; }
.keo-video-library .keo-filter-disclosures { display:flex; align-items:flex-start; flex-wrap:wrap; gap:9px; }
.keo-video-library .keo-filter-disclosures>details { margin:0; max-width:100%; }
.keo-video-library .keo-area-panel>summary,
.keo-video-library .keo-mobile-filter-panel>summary {
  display:inline-flex; gap:7px; align-items:center; list-style:none;
  border:1px solid #b5c3b8; border-radius:6px;
  padding:9px 12px; background:#fff; color:var(--keo-action);
  cursor:pointer; font-weight:600; line-height:1.35;
}
.keo-video-library .keo-area-panel>summary::-webkit-details-marker {display:none;}
.keo-video-library .keo-area-panel>summary::after { content:'▾'; margin-left:3px; }
.keo-video-library .keo-area-panel[open]>summary::after { content:'▴'; }
.keo-video-library .keo-area-panel>summary:hover {background:#f2f6f3;}
.keo-video-library .keo-area-active-count:not(:empty) { font-weight:500; font-size:.86rem; }
.keo-video-library .keo-area-panel-content,
.keo-video-library .keo-mobile-filter-content {
  margin-top:9px; padding:14px; border:1px solid #dce4dc;
  border-radius:8px; background:#fff;
}
.keo-video-library .keo-area-panel-content { max-width:100%; }
.keo-video-library .keo-mobile-filter-panel>summary { margin:0; }
.keo-video-library .keo-extra-preferences {
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  margin:15px 0; padding:12px 0; border-top:1px solid #e1e7e2;
}
.keo-video-library .keo-extra-preferences label {
  display:flex; align-items:center; gap:8px; margin:0; font-size:.9rem;
}
.keo-video-library .keo-extra-preferences select {
  border:1px solid #adbab0; border-radius:5px; background:#fff;
  color:var(--keo-text); padding:7px 9px; min-width:74px; font-size:.9rem;
}
.keo-video-library .keo-view-toggle,
.keo-video-library .keo-view-toggle:visited {
  display:inline-flex; align-items:center; gap:8px; padding:7px 11px;
  border:1px solid #b5c3b8; border-radius:6px;
  color:var(--keo-action) !important; background:#fff;
  text-decoration:none; font-weight:600; font-size:.9rem;
}
.keo-video-library .keo-view-toggle:hover { background:#f2f6f3; }
.keo-video-library .keo-view-toggle svg { width:17px; height:17px; }
.keo-video-library .keo-view-toggle .keo-toggle-icon-grid { display:none; }
.keo-video-library .keo-view-toggle:not(.keo-target-list) .keo-toggle-icon-list { display:none; }
.keo-video-library .keo-view-toggle:not(.keo-target-list) .keo-toggle-icon-grid { display:block; }
.keo-video-library .keo-library-toolbar {
  display:flex; justify-content:flex-start; margin:16px 0 10px;
  gap:0; align-items:center;
}
.keo-video-library .keo-result-count { color:#69756d; font-size:.88rem; }
.keo-video-library .keo-video-grid { margin-top:14px; }
@media (max-width:550px) {
  .keo-video-library .keo-tool-options { gap:8px; }
  .keo-video-library .keo-tool-option { padding:9px 12px; min-height:40px; font-size:.93rem; }
  .keo-video-library .keo-tools-info>summary { width:26px; height:26px; }
  .keo-video-library .keo-library-filters { margin:10px 0 8px; }
  .keo-video-library .keo-area-panel-content,
  .keo-video-library .keo-mobile-filter-content { padding:12px; }
  .keo-video-library .keo-library-toolbar { display:flex; margin:12px 0 6px; }
}


/* 1.3.18 — One area dropdown and a compact desktop-only view toolbar.
   Search and the two Tools choices remain visible on every screen. */
.keo-video-library .keo-filter-disclosures {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
}
.keo-video-library .keo-desktop-preferences {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:14px;
  flex-wrap:wrap;
}
.keo-video-library .keo-desktop-preferences label {
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:0;
  font-size:.9rem;
}
.keo-video-library .keo-desktop-preferences select {
  width:auto;
  min-width:70px;
  border:1px solid #adbab0;
  border-radius:5px;
  padding:7px 9px;
  background:#fff;
  color:var(--keo-text);
  font-size:.9rem;
}
.keo-video-library.keo-ajax-ready .keo-filter-actions { display:none; }
.keo-video-library .keo-filter-actions { margin-top:12px; }
.keo-video-library .keo-tools-info>summary { width:26px; height:26px; padding:0; border:1px solid #98aa9c; border-radius:50%; }
.keo-video-library .keo-info-icon { display:inline; }
@media(max-width:700px) {
  .keo-video-library .keo-desktop-preferences { display:none; }
}
@media(max-width:360px) {
  .keo-video-library .keo-tool-options { gap:6px; }
  .keo-video-library .keo-tool-option { padding:8px 8px; font-size:.87rem; }
  .keo-video-library .keo-tools-info { flex:0 0 auto; }
}


/* 1.3.19 — Keep the tool explanation inside narrow mobile viewports.
   Anchor the popover to the full filter row, not the small i icon. */
.keo-video-library .keo-tool-selector { position:relative; }
.keo-video-library .keo-tools-info { position:static; }
.keo-video-library .keo-tools-info-content {
  left:0;
  right:auto;
  top:calc(100% + 8px);
  width:min(320px, 100%);
  max-width:100%;
}

/* 1.3.19 — Area tags are secondary information in grid mode.
   Keep them full-sized and easy to compare in the list view. */
.keo-video-library .keo-video-grid:not(.keo-video-list) .keo-video-card-category {
  gap:4px;
  margin-top:8px;
}
.keo-video-library .keo-video-grid:not(.keo-video-list) .keo-area-tag {
  font-size:.71rem;
  line-height:1.3;
  font-weight:400;
  padding:2px 5px;
  border-radius:3px;
  color:#607365;
  background:#f4f6f4;
  border-color:#e6ece7;
}
.keo-video-library .keo-video-grid:not(.keo-video-list) .keo-area-tag.is-selected {
  color:#3c6047;
  background:#e9f1ea;
  border-color:#c3d7c6;
}
