/* Ажлын явц drawer. Fixed to the right edge; never over the editor.

   The panel is `position: fixed` and the page is given padding-right while it
   is open, so opening it NARROWS the workspace instead of covering it. That is
   the whole difference between this and the banner it replaced. */

#ashdWork {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  pointer-events: none;
  font: inherit;
}

/* CLOSED IS A BUTTON, NOT A HALF-OPEN PANEL.
   It used to be a 130px vertical tab standing over the corner of whatever
   screen was underneath — neither open nor gone, and catching the corner of a
   comparison list. It is now a 30px square in a 34px gutter the page reserves
   (`body.wd-docked`), so nothing it covers is content. */
#ashdWork .wd-tab {
  pointer-events: auto;
  margin: 10px 2px 0 0;
  align-self: flex-start;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  position: relative;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line, #2c3340);
  border-radius: 8px;
  background: var(--card, #171b23);
  color: var(--text, #e7ecf3);
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}
#ashdWork .wd-tab:hover { background: var(--card2, #1e242e); }
/* The label lives in the tooltip; the gutter is 34px and a word does not fit
   in it without lying over the page again. */
#ashdWork .wd-tab-text { display: none; }
#ashdWork .wd-tab .wd-badge {
  position: absolute;
  transform: translate(9px, -11px);
}
#ashdWork .wd-tab-icon { font-size: 13px; }
#ashdWork .wd-badge {
  min-width: 18px;
  padding: 2px 5px;
  border-radius: 9px;
  background: #d8863a;
  color: #12151b;
  font-weight: 700;
  font-size: 11px;
  text-align: center;
}
#ashdWork.wd-busy .wd-tab { border-color: #d8863a; }

#ashdWork .wd-panel {
  pointer-events: auto;
  width: 340px;
  max-width: 92vw;
  height: 100%;
  display: none;
  flex-direction: column;
  background: var(--card, #171b23);
  border-left: 1px solid var(--line, #2c3340);
  box-shadow: -14px 0 34px rgba(0, 0, 0, .42);
}
#ashdWork.wd-open .wd-panel { display: flex; }
#ashdWork.wd-open .wd-tab { display: none; }

#ashdWork .wd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 13px;
  border-bottom: 1px solid var(--line, #2c3340);
  flex: 0 0 auto;
}
#ashdWork .wd-x {
  border: 0;
  background: transparent;
  color: var(--muted, #8b95a5);
  cursor: pointer;
  font-size: 15px;
  padding: 2px 6px;
}
#ashdWork .wd-x:hover { color: var(--text, #e7ecf3); }

#ashdWork .wd-jobs { flex: 0 0 auto; padding: 0 10px; }
#ashdWork .wd-jobs:empty { display: none; }
#ashdWork .wd-hist {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 10px 22px;
}
#ashdWork .wd-hist-title,
#ashdWork .wd-empty {
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted, #8b95a5);
  margin: 4px 2px 8px;
}
#ashdWork .wd-empty { text-transform: none; letter-spacing: 0; line-height: 1.5; }

#ashdWork .wd-item {
  border: 1px solid var(--line, #2c3340);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 9px 10px;
  margin-bottom: 8px;
  background: var(--card2, #1b212b);
}
#ashdWork .wd-item.wd-ok { border-left-color: #4f9d69; }
#ashdWork .wd-item.wd-warn { border-left-color: #d8a13a; }
#ashdWork .wd-item.wd-err { border-left-color: #c2553f; }
#ashdWork .wd-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
#ashdWork .wd-when { color: var(--muted, #8b95a5); font-size: 11px; }
#ashdWork .wd-sum {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text, #e7ecf3);
}
#ashdWork .wd-kvs { margin-top: 6px; display: grid; gap: 2px; }
#ashdWork .wd-kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted, #8b95a5);
}
#ashdWork .wd-kv b { color: var(--text, #e7ecf3); font-variant-numeric: tabular-nums; }
#ashdWork .wd-undo {
  margin-top: 7px;
  border: 1px solid var(--line, #2c3340);
  background: transparent;
  color: var(--text, #e7ecf3);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 12px;
  cursor: pointer;
}
#ashdWork .wd-undo:disabled { opacity: .5; cursor: default; }

/* THE PAGE MOVES OVER; THE PANEL DOES NOT MOVE ON TOP.
   Both states reserve exactly what they occupy: 340px open, 34px for the
   handle when closed. Nothing is ever laid over the workspace. */
body.wd-pushed { padding-right: 340px; }
body.wd-docked { padding-right: 34px; }

/* §24 — the panel scrolls INSIDE itself. `wd-hist` takes the space that is
   left and scrolls; the head and the live jobs do not move, and neither does
   anything on the page behind it. */
#ashdWork .wd-panel { overscroll-behavior: contain; }
#ashdWork .wd-hist { overscroll-behavior: contain; }

@media (max-width: 1100px) {
  body.wd-pushed { padding-right: 34px; }
  #ashdWork .wd-panel { box-shadow: -14px 0 60px rgba(0, 0, 0, .7); }
}
