/* The data dialogs (datadlg.js): the export preview, my data, sync,
   downloads, Export for Phone or Tablet, help. */
.ddbtns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ddbtns .grow { flex: 1; }
.ddgroup { border: 1px solid var(--surface1); border-radius: 4px; margin: 6px 0; padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 4px; }
.ddgroup legend { padding: 0 4px; font-weight: 600; }
.ddgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 12px; }
.ddgrid label, .ddgroup > label, .ddcheck { display: flex; align-items: center; gap: 4px; }
.ddradio { display: flex; align-items: flex-start; gap: 4px; }
.ddradio input { margin-top: 3px; }
.ddform { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; }
.ddpair { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ddrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.ddrow input[type=text], .ddrow input[type=password], .ddrow input[type=search] { flex: 1; min-width: 120px; width: auto; }
.ddwarn { color: var(--red); margin: 2px 0; }
.ddwarn:empty { display: none; }
.ddhead { white-space: pre-wrap; }
.ddnotes { white-space: pre-wrap; color: var(--subtext); }
.ddtable { border-collapse: collapse; width: 100%; margin: 4px 0; }
.ddtable th, .ddtable td { border: 1px solid var(--surface1); padding: 2px 6px; text-align: left; vertical-align: top; }
.ddtable thead th, .ddtable tr:first-child th { background: var(--surface0); color: var(--subtext); font-weight: normal; }
.ddtable td:not(:first-child) { white-space: nowrap; }
.ddimport .ddtable td { text-align: right; }
.ddsort th { cursor: pointer; white-space: nowrap; position: sticky; top: 0; }
.ddsort tbody tr { cursor: default; }
.ddsort tbody tr:nth-child(even) { background: var(--mantle); }
.ddsort tbody tr.sel { background: var(--surface1); }
.ddsort tbody tr.hiddenrow { color: var(--subtext); font-style: italic; }
.ddsort td:nth-child(2) { white-space: normal; }
.ddtablebox { flex: 3; min-height: 120px; overflow: auto; border: 1px solid var(--surface1); }
.dddetail { flex: 1; min-height: 80px; max-height: 40%; overflow: auto; border: 1px solid var(--surface1); padding: 4px 8px; margin-top: 6px; }
.dddetail p { margin: 0 0 .4em; }
.ddstatus { flex: 1; min-width: 120px; color: var(--subtext); }
.dlgbody.dddownload { display: flex; flex-direction: column; }
.ddpreview { display: flex; flex-direction: column; }
.ddframe { flex: 1; min-height: 240px; width: 100%; border: 1px solid var(--surface1); background: #fff; }
.ddlog { width: 100%; height: calc(100% - 48px); min-height: 260px; resize: none; font: 12px ui-monospace, monospace; }
.ddlist { max-height: 340px; overflow: auto; border: 1px solid var(--surface1); padding: 4px; display: flex; flex-direction: column; gap: 2px; }
.ddkeyhead { margin-top: 10px; border-bottom: 1px solid var(--surface1); padding-bottom: 2px; }
.ddkeytable td { padding: 2px 16px 2px 4px; }
.asklabel { white-space: pre-line; }
.ddform select, .ddpair select { width: auto; min-width: 9em; max-width: 100%; }
.ddpair .ddradio { flex: 0 1 auto; }
.ddcheck { margin: 2px 0; }
.ddkeytable td:first-child { width: 12em; }
/* Download in a browser: a link to the repository's zip, drawn as a button. */
a.btn { color: var(--text); text-decoration: none; text-align: center; cursor: pointer; }
a.btn[aria-disabled=true] { pointer-events: none; opacity: .45; }
html[data-layout=desktop] a.btn[aria-disabled=true] { opacity: 1; color: var(--surface2); background: var(--base); }

/* The list sheets of a phone or tablet (datadlg.js: Download SWORD Modules,
   Download MyBible Modules; library.js: the Library). The list gets the
   room: the search field in the title row beside the ✕, the filters as one
   line of chips no wider than their words, rows of a name, what it is and a
   line of facts, a row's details opened in place, one line at the foot. */
.dlg.lsdlg .dlghead { gap: 6px; padding-bottom: 6px; }
.dlg.lsdlg .dlgtitle { display: none; }
.dlghead .lsfield { flex: 1; min-width: 0; width: auto; min-height: 40px; padding: 7px 12px; }
/* A tablet's sheet is wide enough for the title too. */
@media (min-width: 700px) { .dlg.lsdlg .dlgtitle { display: block; flex: none; max-width: 45%; margin-right: 6px; } }
.dlgbody.lsheet { display: flex; flex-direction: column; gap: 0; overflow: hidden; padding: 0 0 env(safe-area-inset-bottom); }
.lschips { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 12px 8px; }
.lschip { position: relative; flex: none; display: inline-flex; align-items: center; gap: 3px; max-width: 100%; min-height: 34px; padding: 0 10px;
  border: 1px solid var(--surface1); border-radius: 17px; background: var(--surface0); color: var(--text); font-size: .875rem; white-space: nowrap; }
.lschip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--base)); }
/* The picker a tap opens: the <select> itself, over the chip and unseen
   (16px, so an iPhone does not zoom in on it). */
.lschip select { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; font-size: 16px; }
.lschip:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.lschipt { max-width: 11em; overflow: hidden; text-overflow: ellipsis; }
.lscaret { color: var(--subtext); font-size: .8em; }
.lslist { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--surface0); }
.lslist .lsrow { display: block; border-bottom: 1px solid var(--surface0); }
.lslist .lsrow.open { background: var(--mantle); }
.lsline { display: flex; align-items: center; gap: 6px; padding: 0 8px 0 12px; }
.lslist .lshead { flex: 1; min-width: 0; display: flex; flex-direction: row; align-items: center; gap: 8px; width: auto; min-height: 56px; padding: 7px 0;
  border: 0; border-radius: 0; text-align: left; }
.lstext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lsname { font-weight: 600; overflow-wrap: anywhere; }
/* What it is: two lines in the list; a module's, all of it once its row is opened. */
.lsdesc { font-size: .9rem; line-height: 1.3; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dddownload .lsrow.open .lsdesc { display: block; }
/* An opened row's button stands with the others, under its details. */
.lsrow.open .lsact { display: none; }
.lsfacts { font-size: .8rem; line-height: 1.35; color: var(--subtext); overflow-wrap: anywhere; }
.lsfacts .ok, .lsmark { color: var(--green); font-weight: 600; }
.lsfacts .warn { color: var(--orange); }
.lsfacts .bad, .lsbad { color: var(--red); }
.lsmark { flex: none; min-width: 44px; text-align: center; font-size: 1.15rem; }
/* The sheets' buttons: small, their label a word or two. */
.lsheet .btn { display: inline-flex; align-items: center; justify-content: center; flex: none; margin: 0; min-height: 36px; padding: 6px 12px;
  border-radius: 9px; font-size: .9rem; white-space: nowrap; }
.lsheet .btn.lsact { min-width: 52px; min-height: 40px; color: var(--accent); font-weight: 600; }
.lsheet .lsinfo { flex: none; min-width: 44px; min-height: 44px; font-size: 1.2rem; color: var(--accent); }
.lsdetail { display: flex; flex-direction: column; gap: 3px; padding: 0 12px 10px; font-size: .88rem; line-height: 1.35; overflow-wrap: anywhere; }
/* A long text (a module's About) scrolls inside the details. */
.lsabout { max-height: 34vh; max-height: 34dvh; overflow-y: auto; overscroll-behavior: contain; margin-top: 3px; padding: 6px 10px;
  background: var(--base); border: 1px solid var(--surface1); border-radius: 8px; }
.lsabout p { margin: 0 0 .5em; }
.lsabout > :last-child { margin-bottom: 0; }
.lsbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
/* One line, when the browser needs the user to do something or something was done; a tap puts it away. */
.lsmsg { flex: none; max-height: 5.4em; overflow-y: auto; padding: 7px 12px; font-size: .85rem; line-height: 1.3; overflow-wrap: anywhere;
  background: color-mix(in srgb, var(--accent) 14%, var(--base)); border-top: 1px solid var(--surface0); }
.lsmsg:empty { display: none; }
.lsfoot { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 12px; border-top: 1px solid var(--surface0); background: var(--mantle); }
.lscount { flex: 1; min-width: 0; margin: 0; font-size: .8rem; color: var(--subtext); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsnone { margin: 0; padding: 24px 12px; text-align: center; }
.lsheet .covergrid { padding: 10px 12px; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
/* A tile three to a row: a long abbreviation (StrongsHebrew) as small as
   its tile's width needs, and broken rather than cut off at both sides
   where it is still too long. */
.lsheet .cover { container-type: inline-size; }
.lsheet .cover .art { padding: 0 5px; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
.lsheet .cover .art.long { font-size: .85rem; font-size: min(.85rem, 10.5cqi); }
.lsabout hr { border: 0; border-top: 1px solid var(--surface1); margin: 6px 0; }
html:not([data-layout=desktop]) .ddrepos .ddcheck { min-height: 44px; gap: 10px; margin: 0; border-bottom: 1px solid var(--surface0); }
