/* e4 TB1: top bar step (MERGE-STEP-TOPBAR-R6, MERGE-ADD-R6a; Bob's layout a crop). Loaded last (after e4-redesign.css and e4-merge-fix.css).
   From 768 px up only (phones keep today's look, COO 12 rule e). Colours are the design's tokens (--e4r-*). */

/* chapter summaries out (the switch is js/e4/e4_off.js: e4Off.summaries; this css follows the class it sets) */
html.e4-off-summaries #summbutton { display: none !important; }
/* Type ref works through the passage picker; keep the picker out of sight while it does */
html.e4-quiet-picker #passageSelectionModal, html.e4-quiet-picker .modal-backdrop { opacity: 0 !important; transition: none !important; }

@media (min-width: 768px) {
  /* ---- 1. the dark bar holds only the logo, "e4.org" and the panel button ---- */
  html body #stepnavbar .headerButtons > :not(#e4-panel-icon) { display: none !important; }

  /* ---- 2. the passage row, as the crop: Bible, Passage, Type ref, magnifier, View | gear ? More | expand + X ----
     r3.3 (Bob 12:04 PM MT 11-18, CA10 ruling 362935d5): View, then [+ bookmark gear] as one tight group, then [? More expand X] as one tight group */
  html body #columnHolder .passageOptionsGroup:not(.dropdown-menu):not(li) { padding: 8px 12px !important; min-height: 50px; gap: 6px; } /* r3.3: was 8px 16px, 54, gap 8 (CA10 0f53b788 item 1: tight) */
  /* R3 MERGE: with two or more columns each column is about half the window (493 px at 1280): the row (with lane B's quick tools) does not fit on one line and its right
     end (gear, ?, More, expand, X) ran under the next column (found by r3twocol.spec.js / small-b3). The row may wrap now: in a single column it still fits on one line. */
  html body #columnHolder .passageOptionsGroup:not(.dropdown-menu):not(li) { flex-wrap: wrap; row-gap: 4px; }
  html body #columnHolder .passageOptionsGroup .argSummary { display: contents !important; }
  html body #columnHolder .passageOptionsGroup .argSummary > [class^="separator-"] { display: none !important; }
  html body #columnHolder .passageOptionsGroup .argSummary > button.stepButtonTriangle {
    /* r3.3 (CA10 0f53b788 item 1.2, Bob's own idea): the bar's font one step smaller, 15 -> 14 px; buttons 38 -> 34 px high (taps stay >= 32) */
    height: 34px !important; border: 1.5px solid var(--e4r-tan-line, #dccfae) !important; border-radius: 8px !important;
    background: var(--e4r-card, #fff) !important; color: var(--e4r-ink, #1f1c17) !important; font: 600 14px/1 var(--e4r-sans, sans-serif) !important;
    padding: 0 10px !important; margin: 0 !important; box-shadow: none !important; min-width: 0 !important;
  }
  html body #columnHolder .passageOptionsGroup .select-version::before,
  html body #columnHolder .passageOptionsGroup .select-reference::before { content: none !important; display: none !important; }
  /* the magnifier: an icon, not a wide box (a results page keeps its search words in this segment) */
  html body #columnHolder .passageOptionsGroup .argSummary:not(:has(.select-filter)) > button.select-search {
    border-color: transparent !important; background: transparent !important; padding: 0 6px !important; width: 34px; justify-content: center;
  }
  html body #columnHolder .passageOptionsGroup .argSummary:not(:has(.select-filter)) > button.select-search::after { content: none !important; display: none !important; }
  html body #columnHolder .passageOptionsGroup .argSummary > button.select-search .glyphicon { margin-right: 0 !important; font-size: 17px !important; color: var(--e4r-ink, #1f1c17) !important; }
  html body #columnHolder .passageOptionsGroup .argSummary > button.select-filter { border-left: 1.5px solid var(--e4r-tan-line, #dccfae) !important; }

  /* Type ref box */
  .passageOptionsGroup .e4-typeref-wrap { display: inline-flex; align-items: center; position: relative; }
  .passageOptionsGroup input.e4-typeref {
    width: 150px; height: 34px; padding: 0 10px; border: 1.5px solid var(--e4r-tan-line, #dccfae); border-radius: 8px; background: var(--e4r-card, #fff);
    font: 400 14px/1 var(--e4r-sans, sans-serif); color: var(--e4r-ink, #1f1c17); outline: 0; box-shadow: none;
  }
  .passageOptionsGroup input.e4-typeref::placeholder { color: var(--e4r-mut, #7a7368); opacity: 1; }
  .passageOptionsGroup input.e4-typeref:focus { border-color: var(--e4r-acc, #8a4f1d); box-shadow: 0 0 0 2px var(--e4r-tan-accs, #e6c99a); }
  .passageOptionsGroup input.e4-typeref.e4-typeref-bad { border-color: #b3261e; }

  /* r3.3 (CA10 0f53b788 item 1.5): the reference button has a max width and cuts long text with "..." (the full text is its title, js/e4/e4_topbar.js
     refTitle, and shows in the picker); the caret is placed so the cut does not hide it */
  html body #columnHolder .passageOptionsGroup .argSummary > button.select-reference {
    max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; padding-right: 24px !important; display: inline-block;
  }
  html body #columnHolder .passageOptionsGroup .argSummary > button.select-reference::after { position: absolute; right: 10px; top: 50%; margin-top: -2px; }
  /* r3.3 (CA10 0f53b788 item 1.6, last step): in a narrow panel the Type ref box shrinks to a small box and opens in place on click/focus */
  html body #columnHolder .passageOptionsGroup:not(.dropdown-menu):not(li) { container: e4row / inline-size; }
  @container e4row (max-width: 760px) { /* r3.3 05:21Z (T2w): was 700; at row 701-734 px (window 1064-1096, study panel 360 px) the right group wrapped */
    .passageOptionsGroup input.e4-typeref { width: 52px; padding: 0 6px; transition: width .12s; }
    .passageOptionsGroup input.e4-typeref::placeholder { color: transparent; }
    .passageOptionsGroup .e4-typeref-wrap::before { content: 'Ref'; position: absolute; pointer-events: none; padding-left: 8px; font: 400 14px/1 var(--e4r-sans, sans-serif); color: var(--e4r-mut, #7a7368); }
    .passageOptionsGroup .e4-typeref-wrap:focus-within::before, .passageOptionsGroup .e4-typeref-wrap.e4-has-text::before { content: none; }
    .passageOptionsGroup input.e4-typeref:focus { width: 150px; }
    .passageOptionsGroup input.e4-typeref:focus::placeholder { color: var(--e4r-mut, #7a7368); }
  }

  /* menu buttons are interface, not text: a click on them must not clear the reader's selection (Copy verses... copies the selection) */
  .passageOptionsGroup .e4-more, .passageOptionsGroup .e4-view, .passageOptionsGroup .e4-help-btn { -webkit-user-select: none; user-select: none; }

  /* View (r3.1 "Quick view") */
  .passageOptionsGroup .e4-view { order: 1; position: relative; display: inline-block; }
  .passageOptionsGroup .e4-view > a.dropdown-toggle {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1.5px solid var(--e4r-tan-line, #dccfae); border-radius: 8px;
    background: var(--e4r-card, #fff); color: var(--e4r-ink, #1f1c17) !important; font: 600 14px/1 var(--e4r-sans, sans-serif); text-decoration: none; cursor: pointer;
  }
  .passageOptionsGroup .e4-view.e4-view-off > a.dropdown-toggle { color: var(--e4r-mut, #7a7368) !important; }
  .e4-caret { display: inline-block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--e4r-acc, #8a4f1d); }
  .passageOptionsGroup .e4-view-menu { min-width: 260px; padding: 6px 0; background: var(--e4r-tan-bg, #f4ecd8); border: 1px solid var(--e4r-tan-line, #dccfae); border-radius: 10px; left: 0; right: auto; }
  .passageOptionsGroup .e4-view-menu .e4-view-holder { list-style: none; }
  .passageOptionsGroup .e4-view-menu .e4-view-holder h2 { display: none !important; }
  .passageOptionsGroup .e4-view-menu .e4-view-holder > div { background: transparent !important; border: 0 !important; padding: 0 !important; }
  .passageOptionsGroup .e4-view-menu ul.displayModes { margin: 0; padding: 0; list-style: none; }
  .passageOptionsGroup .e4-view-menu .e4-view-none, .passageOptionsGroup .e4-view-menu .e4-view-lang { padding: 8px 16px; color: var(--e4r-mut, #7a7368); font: 400 14px/1.4 var(--e4r-sans, sans-serif); list-style: none; }
  /* r3.3: a line STEP cannot use here (one Bible; two Bibles it cannot compare) stays in the list, greyed (js/e4/e4_topbar.js arrangeModes); STEP's own
     inline "display: none" on it and on the mode box (one Bible) is its verdict and is read there, so it is overruled here, never removed */
  .passageOptionsGroup .e4-view-menu .e4-view-holder > div { display: block !important; }
  .passageOptionsGroup .e4-view-menu ul.displayModes > li { display: list-item !important; list-style: none; }
  .passageOptionsGroup .e4-view-menu ul.displayModes > li.e4-mode-off > a { color: var(--e4r-mut, #7a7368) !important; opacity: .6; cursor: default; }
  .passageOptionsGroup .e4-view-menu ul.displayModes > li.e4-mode-off > a:hover { background: transparent; }

  /* the right end: gear, ?, More, then expand, +, X */
  html body #columnHolder .passageOptionsGroup > .pull-right { display: flex; align-items: center; }
  .passageOptionsGroup > .pull-right > .settingsDropdown { order: 1; }
  .passageOptionsGroup > .pull-right > .e4-help-btn { order: 2; }
  .passageOptionsGroup > .pull-right > .e4-more { order: 3; }
  .passageOptionsGroup > .pull-right > span:has(> .resizePanel) { order: 4; }
  .passageOptionsGroup > .pull-right > .openNewPanel { order: 5; }
  .passageOptionsGroup > .pull-right > .closeColumn { order: 6; }
  .passageOptionsGroup > .pull-right > .copyDropdown { order: 7; }
  .passageOptionsGroup > .pull-right > .nextPreviousChapterGroup { order: 8; }
  html body #columnHolder .passageOptionsGroup > .pull-right .e4-help-btn,
  html body #columnHolder .passageOptionsGroup > .pull-right .e4-more > a.dropdown-toggle {
    width: 30px; height: 34px; display: inline-flex !important; align-items: center; justify-content: center; border-radius: 999px; margin-left: 0; cursor: pointer;
    color: var(--e4r-bar, #22396a) !important; text-decoration: none;
  }
  /* r3.3: [? More expand X] one tight group (was 34 px wide + 4 px apart) */
  html body #columnHolder .passageOptionsGroup > .pull-right > span > a.resizePanel,
  html body #columnHolder .passageOptionsGroup > .pull-right > a.closeColumn { width: 30px; margin-left: 0; }
  /* r3.3: [+ bookmark gear] one tight group: the quick tools sit closer (was 34 px wide + 4 px apart, 10 px after View) and the gear joins them
     (js/e4/e4_topbar.js placeGear moves STEP's own gear span; 768 px and up only) */
  html body #columnHolder .passageOptionsGroup > .e4-quicktools { gap: 2px; margin-left: 0; }
  html body #columnHolder .passageOptionsGroup .e4-quicktools > .e4-qt { width: 30px; }
  html body #columnHolder .passageOptionsGroup .e4-quicktools > .settingsDropdown.e4-gear-near { display: inline-flex; align-items: center; position: relative; margin: 0; background: transparent !important; }
  html body #columnHolder .passageOptionsGroup .e4-quicktools > .settingsDropdown.e4-gear-near > a.showSettings {
    width: 30px; height: 34px; display: inline-flex !important; align-items: center; justify-content: center; border-radius: 999px; margin: 0; padding: 0; cursor: pointer;
    color: var(--e4r-bar, #22396a) !important; text-decoration: none;
  }
  html body #columnHolder .passageOptionsGroup .e4-quicktools > .settingsDropdown.e4-gear-near > a.showSettings:hover { background: var(--e4r-tan-bg, #f4ecd8); }
  html body #columnHolder .passageOptionsGroup > .pull-right .e4-help-btn:hover,
  html body #columnHolder .passageOptionsGroup > .pull-right .e4-more > a.dropdown-toggle:hover { background: var(--e4r-tan-bg, #f4ecd8); }
  .passageOptionsGroup .e4-more { position: relative; }
  .passageOptionsGroup .e4-more-menu { min-width: 230px; padding: 6px 0; background: var(--e4r-tan-bg, #f4ecd8); border: 1px solid var(--e4r-tan-line, #dccfae); border-radius: 10px; }
  .passageOptionsGroup .e4-more-menu li > a, .passageOptionsGroup .e4-view-menu li > a, .passageOptionsGroup .e4-view-menu ul.displayModes li > a {
    display: block; padding: 8px 16px; color: var(--e4r-bar, #22396a) !important; font: 400 15px/1.3 var(--e4r-sans, sans-serif); text-decoration: none; width: auto; height: auto; border-radius: 0;
  }
  .passageOptionsGroup .e4-more-menu li > a:hover, .passageOptionsGroup .e4-view-menu li > a:hover { background: var(--e4r-tan, #eadfc4); }

  /* gear: Site language */
  .passageOptionsGroup .dropdown-menu .e4-site-lang { list-style: none; margin: 8px 0 0; padding: 0; background: var(--e4r-tan, #eadfc4); border-left: 4px solid var(--e4r-tan-mut, #86765c); }
  .passageOptionsGroup .dropdown-menu .e4-site-lang > li { list-style: none; }
  .passageOptionsGroup .dropdown-menu .e4-site-lang .e4-lang-toggle { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; color: var(--e4r-bar, #22396a) !important; font: 400 15px/1.3 var(--e4r-sans, sans-serif); text-decoration: none; cursor: pointer; width: auto; height: auto; border-radius: 0; }
  .passageOptionsGroup .dropdown-menu .e4-site-lang .e4-lang-list { display: none; list-style: none; margin: 0; padding: 0 0 4px; max-height: 220px; overflow-y: auto; background: var(--e4r-paper, #fbf9f4); }
  .passageOptionsGroup .dropdown-menu .e4-site-lang > li.open .e4-lang-list { display: block; }
  .passageOptionsGroup .dropdown-menu .e4-site-lang .e4-lang-list li { list-style: none; }
  .passageOptionsGroup .dropdown-menu .e4-site-lang .e4-lang-list a { display: block; padding: 5px 16px; font: 400 14px/1.3 var(--e4r-sans, sans-serif); color: var(--e4r-bar, #22396a) !important; width: auto; height: auto; border-radius: 0; text-decoration: none; }
  .passageOptionsGroup .dropdown-menu .e4-site-lang .e4-lang-list li.active a { font-weight: 700; }

  /* ---- 3b. passage picker: "Type ref:" label outside left of the box, examples inside ---- */
  #passageSelectionModal .e4-typeref-line { display: flex; align-items: center; gap: 8px; margin: 6px 15px 6px 5px; clear: both; }
  #passageSelectionModal label.e4-typeref-label { flex: 0 0 auto; margin: 0; white-space: nowrap; font: 600 15px/1 var(--e4r-sans, sans-serif); color: var(--e4r-ink, #1f1c17); }
  #passageSelectionModal .e4-typeref-line textarea#enterYourPassage { flex: 1 1 auto; width: auto !important; margin: 0 !important; box-sizing: border-box; }

  /* r3.4 (push 4 rows 1+2, BAM18): ONE row for the longest Bible-name pair at a 1024 px window and for two panels at 1440 (553 px each).
     Spacing only; every control stays, 34 px high, at least 28 px wide. The row's own gap/padding cannot be set from its own container query,
     so they follow the window (narrow window, study panel out) or two passage panels; the controls inside follow the row width.
     Kept LAST in this block: these selectors weigh the same as the rules above, so the later one wins (08:05Z run: placed earlier, they lost). */
  @media (max-width: 1151px) {
    html body #columnHolder .passageOptionsGroup:not(.dropdown-menu):not(li) { gap: 4px; padding: 8px 8px !important; }
  }
  html body #columnHolder:has(> .column:not(.examplesColumn) ~ .column:not(.examplesColumn)) .passageOptionsGroup:not(.dropdown-menu):not(li) { gap: 4px; padding: 8px 8px !important; }
  @container e4row (max-width: 760px) {
    html body #columnHolder .passageOptionsGroup .argSummary > button.stepButtonTriangle { padding: 0 7px !important; }
    html body #columnHolder .passageOptionsGroup .argSummary > button.select-reference { padding-right: 20px !important; }
    html body #columnHolder .passageOptionsGroup .argSummary > button.select-reference::after { right: 7px; }
    html body #columnHolder .passageOptionsGroup .argSummary:not(:has(.select-filter)) > button.select-search { width: 30px; padding: 0 4px !important; }
    .passageOptionsGroup .e4-view > a.dropdown-toggle { padding: 0 7px; gap: 4px; }
    .passageOptionsGroup input.e4-typeref { width: 44px; }
    html body #columnHolder .passageOptionsGroup > .e4-quicktools { gap: 0; }
    html body #columnHolder .passageOptionsGroup > .resultsLabel { margin-left: 0; margin-right: 0; } /* 08:12Z: empty on a passage, 0 px wide, its 12+5 px margins wrapped the row */
    html body #columnHolder .passageOptionsGroup .e4-quicktools > .e4-qt,
    html body #columnHolder .passageOptionsGroup .e4-quicktools > .settingsDropdown.e4-gear-near > a.showSettings,
    html body #columnHolder .passageOptionsGroup > .pull-right .e4-help-btn,
    html body #columnHolder .passageOptionsGroup > .pull-right .e4-more > a.dropdown-toggle,
    html body #columnHolder .passageOptionsGroup > .pull-right > span > a.resizePanel,
    html body #columnHolder .passageOptionsGroup > .pull-right > a.closeColumn { width: 28px; }
  }
  @container e4row (max-width: 600px) {
    html body #columnHolder .passageOptionsGroup .argSummary > button.stepButtonTriangle { font-size: 13px !important; padding: 0 6px !important; }
    html body #columnHolder .passageOptionsGroup .argSummary > button.select-reference { max-width: 120px; padding-right: 18px !important; }
    html body #columnHolder .passageOptionsGroup .argSummary > button.select-reference::after { right: 6px; }
    .passageOptionsGroup .e4-view > a.dropdown-toggle { font-size: 13px; padding: 0 6px; }
    .passageOptionsGroup input.e4-typeref { width: 40px; }
    html body #columnHolder .passageOptionsGroup .argSummary:not(:has(.select-filter)) > button.select-search { width: 28px; }
  }
}
