/* Add Dots PDF — Tools as Acrobat lays them out (js/toolpanel.js)
   ----------------------------------------------------------------
   Only on a wide screen, where body has .acro: a row of tabs, the tools of
   the tab in a panel down the left, the tools reached for most in a rail
   down the right, and the page and zoom in a bar floating over the page. */

/* ---------- the tabs: All tools, View, Edit, Draw, Convert, Sign ---------- */
body.acro #ribTabs #ribInsert,
body.acro #ribTabs #ribPage,
body.acro #ribTabs #ribDoc,
body.acro #ribTabs #ribBooks,
body.acro #ribTabs #ribTool { display: none }
body.acro #ribTabs #ribAll { order: 0 }
body.acro #ribTabs #ribView { order: 1 }
body.acro #ribTabs #ribEdit { order: 2 }
body.acro #ribTabs #ribDraw { order: 3 }
body.acro #ribTabs #ribConvert { order: 4 }
body.acro #ribTabs #ribForm { order: 5 }
body.acro #ribTabs .tab { order: 6 }
/* core's own .on follows the panel it last showed; the tab lit here is the
   one whose tools are in the panel */
body.acro #ribTabs .tab.on { color: var(--text); font-weight: 400 }
body.acro #ribTabs .tab.on::after { content: none }
body.acro #ribTabs .tab.acro-on { color: var(--marker-ink); font-weight: 650 }
body.acro #ribTabs .tab.acro-on::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -9px; height: 2px;
  background: var(--marker); border-radius: 2px
}

/* ---------- the panel down the left ---------- */
body.acro #ribbon {
  flex-direction: column; align-items: stretch; flex: none; width: 252px;
  overflow-y: auto; overflow-x: hidden; padding: 4px 10px 18px; gap: 0;
  border-right: 1px solid var(--line); box-shadow: none
}
body.acro #ribbon[hidden] { display: none }
body.acro.acro-home .qrail,
body.acro.acro-home .srail { visibility: hidden }
body.acro #ribbon .rpan { display: flex; flex-direction: column; align-items: stretch; gap: 0 }
body.acro #ribbon .rpan[hidden] { display: none }
body.acro #ribbon #panPage { order: 1 }
body.acro #ribbon #panInsert { order: 2 }
body.acro #ribbon #panEdit { order: 3 }
body.acro #ribbon #panDoc { order: 4 }
body.acro #ribbon #panBooks { order: 5 }
body.acro #ribbon .acro-head {
  display: flex; align-items: center; justify-content: space-between; order: -1;
  margin: 12px 4px 2px; font-size: 17px; font-weight: 650; color: var(--text)
}
body.acro #ribbon #acroClose { flex: none; width: 32px; min-height: 32px; height: 32px; padding: 0; justify-content: center }
body.acro #ribbon #acroClose svg { width: 18px; height: 18px }
body.acro #ribbon .sep,
body.acro #ribbon .navtools,
body.acro #ribbon .zoomval,
body.acro #ribbon #tEditPan,
body.acro #ribbon #tSelect,
body.acro #ribbon #tDrawPan,
body.acro #ribbon #tDrawSelect { display: none }
body.acro #ribbon #tSelect + .tsep,
body.acro #ribbon #tDrawSelect + .tsep { display: none }
body.acro #ribbon .grp { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 1px }
body.acro #ribbon .grp[data-head]::before {
  content: attr(data-head); flex: 0 0 100%; margin: 16px 6px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-dim)
}
body.acro #ribbon .btn {
  flex: 1 1 100%; flex-direction: row; justify-content: flex-start; gap: 12px;
  height: 36px; min-height: 36px; min-width: 0; max-width: none; padding: 0 8px; border-radius: 6px
}
body.acro #ribbon .btn::after {
  font-size: 13.5px; line-height: 1.2; color: var(--text); text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0
}
body.acro #ribbon .btn:disabled::after { color: var(--text-dim) }
body.acro #ribbon .btn.on { background: var(--on-bg); color: var(--on-ink) }
body.acro #ribbon .btn.on::after { color: var(--on-ink) }
/* no coloured or grey outlines in the list: the tool in hand is the grey tile,
   the row under the pointer a fainter grey, and the keyboard's ring only shows
   on :focus-visible (app.css) */
body.acro #ribbon .btn, body.acro #ribbon .btn:hover:not(:disabled), body.acro #ribbon .btn.on {
  border-color: transparent; box-shadow: none
}
body.acro #ribbon .btn:hover:not(:disabled):not(.on) { background: var(--hover, rgba(255, 255, 255, .06)) }
body.acro #ribbon .btn.on:hover:not(:disabled) { background: var(--on-bg) }
body.acro #ribbon .btn:focus:not(:focus-visible) { outline: none }
body.acro #ribbon .btn .lbl { display: none }
body.acro #ribbon #btnTheme::after { content: attr(data-label) }
/* a colour arrow sits beside its tool, not on a row of its own */
body.acro #ribbon .btn:has(+ .btn[id$="Dd"]) { flex: 1 1 calc(100% - 34px) }
body.acro #ribbon .btn[id$="Dd"] { flex: 0 0 32px; padding: 0; justify-content: center }
body.acro #ribbon .btn[id$="Dd"]::after { content: none }
body.acro #ribbon .tsep { flex: 0 0 100%; width: auto; height: 1px; margin: 5px 6px; background: var(--line) }
body.acro #ribbon .cnt { margin-left: auto }

/* All tools: a list of the tabs */
body.acro #panAll .btn { height: 52px; min-height: 52px }
body.acro #panAll .btn::after { white-space: normal }
body.acro #panAll .btn small { display: none }
#panAll { display: none }
body.acro #ribbon #panAll:not([hidden]) { display: flex }

/* ---------- the tool in hand: its options at the top of the panel ----------
   As Acrobat's Format text over Modify page: there only while a tool is in
   hand or a mark is picked up (core shows #panTool then), the controls
   wrapped to the panel's width */
body.acro #ribbon #panTool { order: -1; padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); overflow: visible }
body.acro #ribbon #panTool[hidden] { display: none }
body.acro #ribbon #panTool .navtools,
body.acro #ribbon #panTool .navtools + .sep { display: none }
body.acro #ribbon #panTool #grpToolNow .btn { pointer-events: none }
body.acro #ribbon #panTool #grpToolNow .btn::after { font-weight: 650 }
body.acro #ribbon #panTool .toolprops { flex-direction: column; align-items: stretch; flex-wrap: nowrap }
/* in a column the heading and the bars keep their own height */
body.acro #ribbon #panTool .toolprops::before,
body.acro #ribbon #panTool .toolprops > * { flex: none }
body.acro #ribbon #panTool .toolprops[hidden] { display: none }
body.props-in-ribbon.acro #ribbon #panTool #modeBar,
body.props-in-ribbon.acro #ribbon #panTool .markpop {
  flex-wrap: wrap; align-items: center; gap: 8px; min-height: 0; padding: 2px 4px;
  background: none; border: none; box-shadow: none; overflow: visible
}
/* the help in full, as wide as the controls above it */
body.acro #ribbon #panTool #modeBar .hint {
  flex: 0 0 100%; order: 90; max-width: none; min-width: 0; font-size: 12px; line-height: 1.4;
  display: block; -webkit-line-clamp: unset; overflow: visible; white-space: normal; text-overflow: clip
}
body.acro #ribbon #panTool #modeBar .grow { display: none }
body.acro #ribbon #panTool .btn { flex: none; width: auto; height: 32px; min-height: 32px; padding: 0 8px }
body.acro #ribbon #panTool #grpToolNow .btn { flex: 1 1 100%; justify-content: flex-start; height: 34px }
body.acro #ribbon #panTool select,
body.acro #ribbon #panTool input:not([type="range"]) { max-width: 100% }
/* every row of controls (the text tool's, Dimension's Scale and Units, the
   others') wraps inside the panel, edge to edge with the help below it */
body.acro #ribbon #panTool .txctl,
body.acro #ribbon #panTool .swatches,
body.acro #ribbon #panTool .widths { flex-wrap: wrap; row-gap: 6px; column-gap: 6px; max-width: 100% }
body.acro #ribbon #panTool .txctl:not([hidden]) { display: flex; align-items: center; flex: 0 0 100%; min-width: 0 }
body.acro #ribbon #panTool .txctl select { flex: 1 1 64px; min-width: 0 }
body.acro #ribbon #panTool .txctl .anno-lbl { flex: none }
/* Colour and Line width share their row, end to end */
body.acro #ribbon #panTool .swatches:not([style*="none"]),
body.acro #ribbon #panTool .widths:not([style*="none"]) { flex: 1 1 0; min-width: 0 }
body.acro #ribbon #panTool .swatches > button,
body.acro #ribbon #panTool .widths > button { flex: 1 1 auto; justify-content: space-between }
body.acro #ribbon #panTool #mpExt,
body.acro #ribbon #panTool #mpExt > div,
body.acro #ribbon #panTool #mpExt .row { flex-wrap: wrap }

/* ---------- the quick tools, floating over the page ----------
   As Acrobat's: a bar over the left of the page area, not a column of its
   own; dragged by its grip it goes anywhere over the page (js/toolpanel.js) */
.qrail { display: none }
body.acro .qrail {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  position: absolute; z-index: 6; top: 12px; left: 12px; padding: 4px 6px 8px;
  background: var(--chrome); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .16)
}
/* room on the left of the page area, so a page fitted to its width starts
   clear of the bar (core computeFit reads the padding) */
body.acro .main > .stage { padding-left: 78px }
/* the grip: drag here to move the bar */
body.acro .qrail .qgrip {
  width: 40px; height: 14px; display: flex; align-items: center; justify-content: center;
  cursor: grab; touch-action: none
}
body.acro .qrail .qgrip::before { content: ""; width: 26px; height: 4px; border-radius: 2px; background: var(--line) }
/* moved from its place: the arrow beside the grip takes it back */
body.acro .qrail .qtop { display: flex; align-items: center; justify-content: center; height: 16px }
body.acro .qrail .qhome {
  display: none; width: 18px; height: 16px; padding: 0; border: 0; border-radius: 4px; background: none;
  color: var(--btn, var(--marker)); cursor: pointer; align-items: center; justify-content: center
}
body.acro .qrail .qhome svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.200; stroke-linecap: round; stroke-linejoin: round }
body.acro .qrail .qhome:hover { background: var(--chrome-2) }
body.acro .qrail.moved .qhome { display: flex }
body.acro .qrail.moved .qgrip { width: 22px }
body.acro .qrail.moved .qgrip::before { width: 18px }
body.acro .qrail.dragging, body.acro .qrail.dragging .qgrip { cursor: grabbing }
body.acro .qrail .btn {
  width: 40px; height: 40px; min-width: 40px; padding: 0; justify-content: center; border-radius: 8px
}
/* 24px with a one-device-pixel line, snapped to the pixel grid as the
   ribbon's are (toolbar.js snapIcons): at 22px their lines fell between pixels */
body.acro .qrail .btn svg { width: 24px; height: 24px; stroke-width: var(--ico-stroke, 1); flex: none }
/* the tool in hand: a grey tile with a violet icon, the way Acrobat shows it */
body.acro .qrail .btn.on { background: var(--on-bg); color: var(--on-ink) }
body.acro .qrail .btn.on svg { stroke: currentColor }

/* ---------- the page, and the sidebar on its right ---------- */
body.acro .main > #ribbon { order: 0 }
body.acro .main > .stage { order: 2 }
body.acro .main > #rail { order: 3; border-right: none; border-left: 1px solid var(--line) }
/* #rail's own tab row (Pages, Find, Properties, Notes, Bookmarks, Layers…) is
   what the icon rail below is actually clicking (src.click(), js/toolpanel.js)
   — here it would only be a second, redundant switcher stacked above whatever
   panel is open. Hiding it costs nothing: the buttons, their handlers and
   their .on state are untouched, and the open panel still closes by pressing
   its own lit icon again in .srail. */
body.acro .rail-tabs { display: none }

/* ---------- the rail down the right: side panels, then page and zoom ---------- */
.srail, .sbrot { display: none }
body.acro .srail {
  display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; order: 4;
  width: 54px; padding: 10px 0 12px; overflow-y: auto; scrollbar-width: none;
  background: var(--chrome); border-left: 1px solid var(--line)
}
body.acro .srail > .btn {
  width: 40px; height: 40px; min-width: 40px; padding: 0; justify-content: center; border-radius: 8px
}
body.acro .srail > .btn svg { width: 24px; height: 24px; stroke-width: var(--ico-stroke, 1); flex: none }
body.acro .srail > .btn.on { background: var(--on-bg); color: var(--on-ink) }
body.acro .srail .sgrow { flex: 1 0 12px }
body.acro[data-skin="wps"] .srail .statusbar {
  display: flex; flex-direction: column; align-items: center; gap: 2px; position: static;
  width: auto; height: auto; padding: 8px 0 0; margin: 0; border: none; border-top: 1px solid var(--line);
  border-radius: 0; background: none; box-shadow: none
}
body.acro[data-skin="wps"] .srail .statusbar[hidden] { display: none }
body.acro .srail .statusbar [data-a="rail"],
body.acro .srail .statusbar [data-a="first"],
body.acro .srail .statusbar [data-a="last"],
body.acro .srail .statusbar .sbzoom,
body.acro .srail .statusbar .sbgrow,
body.acro .srail .statusbar .sbsep { display: none }
body.acro .srail .statusbar .sbpage { order: 1; flex-direction: column; gap: 4px; margin-bottom: 2px }
body.acro .srail .statusbar .sbpage input { width: 40px; text-align: center }
body.acro .srail .statusbar [data-a="prev"] { order: 2 }
body.acro .srail .statusbar [data-a="next"] { order: 3; margin-bottom: 6px }
body.acro .srail .statusbar [data-a="prev"] svg,
body.acro .srail .statusbar [data-a="next"] svg { transform: rotate(90deg) }
body.acro .srail .statusbar .sbrot { display: inline-flex; order: 4 }
body.acro .srail .statusbar [data-a="fitw"] { order: 5 }
body.acro .srail .statusbar [data-a="fitp"] { order: 6 }
body.acro .srail .statusbar [data-a="two"] { order: 7 }
body.acro .srail .statusbar [data-a="in"] { order: 8; margin-top: 6px }
body.acro .srail .statusbar .sbpct { order: 9; min-width: 0; text-align: center; font-size: 11px }
body.acro .srail .statusbar [data-a="out"] { order: 10 }
body.acro .srail .statusbar button { width: 36px; height: 32px; justify-content: center }
body.acro .srail .statusbar svg { width: 19px; height: 19px }
