/* PC audiobook saving and optional personal audio import. */
.ytFindItem>.offlineImportToggle{
  display:inline-flex;align-items:center;justify-content:center;max-width:100%;
  margin:8px 0 0;padding:7px 10px;border:1px solid #d9c69f;border-radius:9px;
  background:#fbf3e4;color:#674c22;font:750 11px/1.2 system-ui;cursor:pointer;
  -webkit-tap-highlight-color:transparent
}
.ytFindItem>.offlineImportToggle[aria-expanded="true"]{background:#eee1c9;border-color:#c6a66b}
.offlineImportPanel:not([hidden]){
  position:relative;box-sizing:border-box;display:flex;flex-direction:column;gap:9px;
  width:100%;margin:0;padding:12px;
  background:#f9f6ee;border:1px solid #e0d5c2;border-radius:12px;
  font:12px/1.5 system-ui;color:#564b3e
}
.offlineImportPanel[hidden]{display:none!important}
.offlineImportPanel p{margin:0}
.offlineImportPanel button{
  border:1px solid #d9c69f;border-radius:8px;background:#fffdfa;color:#654a29;
  padding:8px 10px;font:700 12px/1.25 system-ui;min-height:33px;cursor:pointer
}
.offlineImportPanel .offlineImportChoose{background:#345c66;color:white;border-color:#345c66}
.offlineImportPanel button:disabled,.offlineImportPanel input:disabled{opacity:.55;cursor:progress}
.offlineImportUrlRow{display:flex;flex-wrap:wrap;gap:6px}
.offlineImportUrlRow input{
  box-sizing:border-box;flex:1 1 190px;width:100%;min-width:0;padding:9px 10px;
  background:#fff;border:1px solid #ded2c3;border-radius:8px;font:12px system-ui;color:#30271d
}
.offlineImportSaved{display:flex;flex-direction:column;gap:6px}
.offlineImportSaved:empty{display:none}
.offlineImportSaved strong{font-size:11px}
.offlineImportSavedRow{display:flex;align-items:center;gap:6px;padding:5px 0;border-top:1px solid #e7ddce}
.offlineImportSavedRow span{flex:1;min-width:0;overflow-wrap:anywhere;font-size:11px}
.offlineImportSavedRow button{flex:0 0 auto;min-width:33px}
.offlineImportStatus:empty{display:none}
.offlineImportStatus{font-size:12px;font-weight:650;color:#366b52}
.offlineImportStatus[data-error="true"]{color:#a13f31}
.nightMode .ytFindItem>.offlineImportToggle{background:#403a34;color:#f1d09c;border-color:#756044}
.nightMode .offlineImportPanel{background:#2e2c30;color:#d4c8b8;border-color:#514a4b}
.nightMode .offlineImportPanel button{background:#3b3b40;color:#f3dfbd;border-color:#6a6060}
.nightMode .offlineImportPanel .offlineImportChoose{background:#466d76;color:#fff;border-color:#466d76}
.nightMode .offlineImportUrlRow input{background:#25252a;color:#eee;border-color:#625c60}
.nightMode .offlineImportSavedRow{border-color:#514a4b}
.nightMode .offlineImportStatus{color:#96d0b2}
.nightMode .offlineImportStatus[data-error="true"]{color:#f5a597}

@media(prefers-reduced-motion:reduce){.offlineImportPanel,.offlineImportToggle{transition:none}}


/* The PC path is primary; manual imports remain in a collapsed fallback. */
.offlineImportPcToggle{align-self:flex-start}
.offlineImportPcConfig{display:flex;flex-direction:column;gap:7px;padding:10px;
  background:#ede8dc;border:1px solid #ded2bd;border-radius:9px}
.offlineImportPcConfig[hidden]{display:none!important}
.offlineImportPcConfig input{box-sizing:border-box;width:100%;min-width:0;padding:9px 10px;
  background:#fff;border:1px solid #d1c4b3;border-radius:8px;font:13px system-ui;color:#30271d}
.offlineImportPcConfig button{align-self:flex-start;background:#345c66;color:white;border-color:#345c66}
.offlineImportPcConfig p{font-size:11px;opacity:.88;line-height:1.45}
.offlineImportOther{border-top:1px dashed #d5c6b0;padding-top:9px}
.offlineImportOther summary{font-size:11px;cursor:pointer;opacity:.83}
.offlineImportOther[open] summary{margin-bottom:8px}
.offlineImportOther button{margin:4px 0}
.nightMode .offlineImportPcConfig{background:#39363a;border-color:#5a5251}
.nightMode .offlineImportPcConfig input{background:#25252a;border-color:#625c60;color:#eee}
.nightMode .offlineImportOther{border-color:#625c60}


/* Audio Manager-inspired clear preset and progress controls. */
.offlineImportProfileRow{display:flex;flex-direction:column;gap:5px;font:650 11px/1.35 system-ui}
.offlineImportProfileRow select{width:100%;min-width:0;box-sizing:border-box;
  padding:9px 10px;background:#fff;border:1px solid #d9c69f;color:#403326;
  border-radius:8px;font:600 12px system-ui}
.offlineImportProfileHint{font-size:11px;opacity:.8}
.offlineImportProgress{display:block;width:100%;height:8px;accent-color:#497e76}
.offlineImportProgress[hidden],.offlineImportCancel[hidden]{display:none!important}
.offlineImportPanel .offlineImportCancel{align-self:flex-start;border-color:#aa7366;
  color:#934e41;background:#fbefeb}
.offlineImportStatus{overflow-wrap:anywhere}
.nightMode .offlineImportProfileRow select{background:#25252a;color:#f1e6d6;
  border-color:#625c60}
.nightMode .offlineImportPanel .offlineImportCancel{background:#463637;
  color:#f5b3a4;border-color:#9b6a68}

/* Compact YouTube results: artwork | details | download icon.
   Existing conversion/configuration panel expands under the whole card. */
.ytFindItem{
  display:grid;grid-template-columns:104px minmax(0,1fr) 40px;
  column-gap:10px;row-gap:9px;align-items:start;
}
.ytFindItem>.ytFindImageLink{grid-column:1;grid-row:1;width:100%;max-width:none;min-width:0}
.ytFindItem>.ytFindInfo{grid-column:2;grid-row:1;min-width:0}
.ytFindItem>.offlineImportToggle{
  grid-column:3;grid-row:1;justify-self:end;align-self:start;
  box-sizing:border-box;width:38px;min-width:38px;height:38px;
  max-width:none;margin:0;padding:0;border-radius:12px;
  font:700 22px/1 system-ui;
}
.ytFindItem>.offlineImportPanel:not([hidden]){
  grid-column:1/-1;grid-row:2;min-width:0;max-width:100%;
  margin:0;position:relative;z-index:1;
}
.ytFindItem>.offlineImportPanel[hidden]{display:none!important}
.ytFindNarratorLink,.ytFindTitleLink{color:inherit;text-decoration:none;overflow-wrap:anywhere}
.ytFindNarratorLink:active,.ytFindTitleLink:active{opacity:.68}
.ytFindNarratorLink:hover,.ytFindTitleLink:hover{text-decoration:underline;text-underline-offset:3px}
.ytFindNarratorLink:focus-visible,.ytFindTitleLink:focus-visible,
.ytFindItem>.offlineImportToggle:focus-visible{outline:2px solid #986b2e;outline-offset:3px}
@media(max-width:560px){
  .ytFindItem{grid-template-columns:90px minmax(0,1fr) 36px;column-gap:8px}
  .ytFindItem>.offlineImportToggle{width:36px;min-width:36px;height:36px}
}
@media(max-width:355px){
  .ytFindItem{grid-template-columns:76px minmax(0,1fr) 34px;column-gap:7px}
  .ytFindItem>.offlineImportToggle{width:34px;min-width:34px;height:34px}
}

/* Temporary player-first search action. The old offline importer is kept in
   the repository but is not bootstrapped on the public search page. */
.ytFindItem>.ytFindPlayButton{
  grid-column:3;grid-row:1;justify-self:end;align-self:start;
  box-sizing:border-box;display:grid;place-items:center;
  width:38px;height:38px;max-width:100%;border-radius:12px;
  background:#fbf3e4;border:1px solid #d9c69f;color:#674c22;
  font:700 15px/1 system-ui;text-decoration:none;cursor:pointer;
  padding:0 0 0 2px;-webkit-tap-highlight-color:transparent
}
.ytFindItem>.ytFindPlayButton:active{background:#eee1c9;border-color:#c6a66b}
.ytFindItem>.ytFindPlayButton:focus-visible{outline:2px solid #986b2e;outline-offset:3px}
.nightMode .ytFindItem>.ytFindPlayButton{background:#403a34;color:#f1d09c;border-color:#756044}
@media(max-width:560px){
  .ytFindItem>.ytFindPlayButton{width:36px;height:36px}
}
@media(max-width:355px){
  .ytFindItem>.ytFindPlayButton{width:34px;height:34px}
}
