/* Study Quest — hotbar.css (V7.2.4, lane B builder v724-hotbar; js/ui-hotbar.js)
 * The hotbar like WoW's action bars, in the HUD's Ember & Iron (hud.css draws the sockets: .ab-btn, .ab-plate, .mm-btn):
 *   the extra bars stacked above the main bar · the three books standing left of it (closed books, as thick as what they hold)
 *   · empty sockets · dragging (the ghost, the drop target) · the right-click menu · the "More" fold of a small window ·
 *   the Darovnik (the book of actions; was the Veshtina, its classes and ids stay) and the Key bindings window.
 */

/* ================================================================== the bars */
.hk-stack {
  position: absolute;
  left: 50%;
  bottom: calc(var(--xp-h) + var(--xp-bottom) + 3px + var(--ab) + 16px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.hk-stack > .ab-plate { pointer-events: auto; }
.ab-plate--extra { padding: 6px 12px 4px; border-radius: var(--cx-r-2) var(--cx-r-2) 0 0; box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.55), inset 0 0 0 3px rgba(0, 0, 0, 0.15), 0 -3px 10px rgba(0, 0, 0, 0.45); }
.ab-plate--extra + .ab-plate--extra { border-radius: 0; }
.hk-plate3:not(.hidden) + .hk-plate2 { border-radius: 0; }
.ab-plate.hidden { display: none; }
/* the chat, the session block and the cards rise above the extra bars (--bar-top: the bars' row height) */
.hud.hk-rows-2 { --bar-top: calc(84px + var(--ab) + 11px); }
.hud.hk-rows-3 { --bar-top: calc(84px + 2 * (var(--ab) + 11px)); }

/* empty sockets: a dim socket, no glyph */
.ab-btn.ab-empty { cursor: default; background: radial-gradient(circle at 50% 40%, #15171a, #0a0b0c 70%); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000, inset 0 0 0 2px rgba(122, 82, 41, 0.28), inset 0 6px 11px rgba(0, 0, 0, 0.7); }
.ab-btn.ab-empty::before, .ab-btn.ab-empty::after { opacity: 0; }
body.hk-dragging .ab-btn.ab-empty, body.hk-holding .ab-btn.ab-empty { box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000, inset 0 0 0 2px rgba(226, 181, 106, 0.55), inset 0 6px 11px rgba(0, 0, 0, 0.6); }
.ab-btn.hk-unknown { opacity: 0.5; }
.hk-hide { display: none !important; }
.hk-more { display: none; }

/* dragging: the source fades, the socket under the pointer lights, the ghost follows the pointer */
.hk-slot.hk-drag-src { opacity: 0.35; }
.hk-slot.hk-drop { outline: 2px solid var(--cx-torch, #ff8a3d); outline-offset: 2px; }
.mm-btn.hk-drop { outline-offset: 1px; }
body.hk-dragging, body.hk-dragging * { cursor: grabbing !important; }
body.hk-holding .hk-slot { cursor: copy; }
.hk-ghost {
  position: fixed;
  z-index: 3000;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  pointer-events: none;
  border: 2px solid;
  border-color: #e2b56a #86592a #3e2711 #c48a45;
  border-radius: 4px;
  background: radial-gradient(circle at 38% 28%, #2b2f35, #17191d 56%, #08090a 100%);
  box-shadow: 0 0 0 1px #000, 0 0 14px rgba(255, 138, 61, 0.55), 0 6px 14px rgba(0, 0, 0, 0.7);
  color: var(--cx-bone, #e8dcc0);
  opacity: 0.95;
}
.hk-ghost .icon { width: 24px; height: 24px; }
.hk-ghost [fill="currentColor"] { fill: url(#ei-glyph-bronze); }
.hk-ghost [stroke="currentColor"] { stroke: url(#ei-glyph-bronze); }
.hk-ghost--off { opacity: 0.55; filter: grayscale(0.8); border-color: #8a2a18 #4a1208 #2a0a04 #6a1e10; }
.hk-ghost--off::after { content: '\00d7'; position: absolute; right: -9px; top: -11px; font: 700 16px/1 var(--cx-font-num, sans-serif); color: #ff7a6a; text-shadow: 0 1px 0 #000; }

/* the ring round the minimap: the hotbar's menu group (hud.css draws .mm-btn) */
.mm-btn .hk-ring-icon { display: grid; place-items: center; pointer-events: none; }
.mm-btn .hk-ring-icon .icon { width: 15px; height: 15px; filter: drop-shadow(0 1px 0 #000); }
.mm-btn.mm-empty { opacity: 0.55; cursor: default; }
.mm-btn.open { color: var(--cx-gold-leaf, #e2b56a); }

/* ================================================================== the three books (closed, standing left of the bar) */
/* V7.23: the books live in the Torba; an empty books group hides, and shows again while a button is dragged (drop a book there) */
.hk-books.is-empty { display: none; }
body.hk-dragging .hk-books.is-empty { display: flex; }
.hk-books {
  position: absolute;
  right: calc(100% + 4px);
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 6px 8px 5px;
  border: 1px solid #000;
  border-bottom: 0;
  border-radius: var(--cx-r-2, 4px) var(--cx-r-2, 4px) 0 0;
  background: linear-gradient(180deg, rgba(23, 25, 28, 0.92), rgba(8, 9, 10, 0.96));
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.55), inset 0 0 0 2px rgba(122, 82, 41, 0.25), 0 -3px 10px rgba(0, 0, 0, 0.45);
}
.hk-books > .ab-btn { margin-bottom: 1px; }
.hk-book {
  --bk-c1: #2a4170; --bk-c2: #15203a; --bk-trim: #b8955a; --bk-ink: #f1dfb2;
  position: relative;
  flex: none;
  width: calc(38px + 4px + var(--hk-thick, 0.35) * 12px);
  height: calc(var(--ab) + 6px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hk-book--letopis { --bk-c1: #6a2219; --bk-c2: #2e0d09; --bk-trim: #d8b36a; --bk-ink: #f3d79a; }
.hk-book--azbuka { --bk-c1: #3d6b49; --bk-c2: #1c3a25; --bk-trim: #c9a44f; --bk-ink: #f2e5c0; }
/* the page block seen past the front board: as thick as the book is full (lane C's growing books feed --hk-thick) */
.hk-bk-edge {
  position: absolute;
  right: 0;
  top: 3px;
  bottom: 2px;
  width: calc(4px + var(--hk-thick, 0.35) * 12px);
  border-radius: 0 2px 2px 0;
  background: repeating-linear-gradient(90deg, #efe4c8 0 1px, #d8c9a4 1px 2px), #e9dcbb;
  box-shadow: inset 0 2px 0 var(--bk-c2), inset 0 -2px 0 var(--bk-c2), inset -1px 0 0 rgba(0, 0, 0, 0.35), 1px 1px 2px rgba(0, 0, 0, 0.6);
}
.hk-bk-cover {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 38px;
  border-radius: 2px 3px 3px 2px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0) 5px, rgba(255, 255, 255, 0.06) 7px, rgba(0, 0, 0, 0) 9px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 0 2px, rgba(0, 0, 0, 0.04) 2px 4px),
    linear-gradient(160deg, var(--bk-c1), var(--bk-c2));
  box-shadow: 0 0 0 1px #050302, inset 0 0 0 2px rgba(0, 0, 0, 0.25), inset -2px 0 0 rgba(255, 255, 255, 0.05), 2px 3px 5px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transition: transform 0.08s ease-out, filter 0.12s;
}
.hk-bk-cover::before {   /* the tooled fillet inside the board's edge */
  content: '';
  position: absolute;
  inset: 4px 3px 4px 7px;
  border: 1px solid var(--bk-trim);
  border-radius: 1px;
  opacity: 0.7;
}
.hk-bk-band { position: absolute; left: 0; width: 6px; top: 7px; height: 2px; background: var(--bk-trim); opacity: 0.85; }
.hk-bk-band--low { top: auto; bottom: 7px; }
.hk-bk-title {
  position: absolute;
  left: 7px;
  right: 3px;
  top: 50%;
  transform: translateY(-58%);
  text-align: center;
  font: 700 19px/1 var(--cx-font-title, serif);
  color: var(--bk-ink);
  text-shadow: 0 1px 0 #000, 0 0 6px rgba(0, 0, 0, 0.5);
}
.hk-book .ab-key { top: 1px; right: auto; left: 30px; z-index: 2; }
.hk-bk-name {
  position: absolute;
  left: 4px;
  width: 34px;
  bottom: 2px;
  z-index: 2;
  text-align: center;
  font: 700 11px/1 var(--cx-font-num, sans-serif);
  letter-spacing: -0.02em;
  color: var(--bk-ink);
  text-shadow: var(--outline, 0 1px 0 #000);
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}
.hk-book:hover .hk-bk-cover, .hk-book.open .hk-bk-cover { filter: brightness(1.25) saturate(1.1); box-shadow: 0 0 0 1px #050302, 0 0 10px rgba(255, 170, 80, 0.55), 2px 3px 5px rgba(0, 0, 0, 0.7); }
.hk-book.pressed .hk-bk-cover { transform: translateY(1px) scale(0.97); }
.hk-book:focus-visible { outline: 2px solid var(--cx-torch, #ff8a3d); outline-offset: 2px; }
.hk-book .ab-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle, rgba(255, 220, 160, 0.6), rgba(255, 220, 160, 0) 70%); }
.hk-book.pressed .ab-flash { animation: abFlash 0.35s ease-out; }

/* ================================================================== the "More" fold (compact: 480 x 360) */
.hk-fold {
  position: absolute;
  left: 50%;
  bottom: calc(var(--xp-h) + var(--xp-bottom) + var(--ab) + 22px);
  transform: translateX(-50%);
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--ab));
  justify-content: center;
  gap: var(--ab-gap);
  width: min(460px, calc(100vw - 12px));
  max-height: calc(100vh - 120px);
  overflow: auto;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid #000;
  border-radius: var(--cx-r-2, 4px);
  background: var(--cx-bg-iron, #17191c);
  box-shadow: inset 0 0 0 2px rgba(122, 82, 41, 0.35), 0 8px 24px rgba(0, 0, 0, 0.7);
}
.hk-fold.hidden { display: none; }
.hk-more.open { box-shadow: 0 0 0 1px #000, 0 0 10px rgba(255, 138, 61, 0.6); }

/* ================================================================== the right-click menu */
.hk-menu {
  position: fixed;
  z-index: 2600;
  min-width: 190px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--cx-bg-oak, #1c1611);
  border: 1px solid var(--cx-line, #3d2f1d);
  border-radius: var(--cx-r-2, 4px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75);
}
.hk-menu-item {
  display: block;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-radius: 3px;
  background: none;
  text-align: left;
  font: 400 15px/1.25 var(--cx-font-body, serif);
  color: var(--cx-text, #e8dcc0);
  cursor: pointer;
}
button.hk-menu-item:hover, button.hk-menu-item:focus-visible { background: rgba(226, 181, 106, 0.16); color: #fff3d6; outline: none; }
.hk-menu-head { cursor: default; color: var(--cx-gold-leaf, #e2b56a); border-bottom: 1px solid rgba(226, 181, 106, 0.2); border-radius: 0; margin-bottom: 2px; }
.hk-menu-item.is-dim { color: var(--cx-text-dim, #a89a80); cursor: default; }
.hk-menu-item .codex-kbd { font-size: 12px; margin-left: 4px; }

/* ================================================================== the Darovnik and Key bindings windows */
.hk-win .win-body { padding: 12px 16px 16px; }
.hk-lead { margin: 0 0 8px; font: 400 15px/1.45 var(--cx-font-body, serif); color: var(--cx-text, #e8dcc0); }
.hk-word { color: var(--cx-gold-leaf, #e2b56a); border-bottom: 1px dotted rgba(226, 181, 106, 0.6); cursor: help; }
.hk-h3 { margin: 12px 0 6px; font: 700 13px/1.2 var(--cx-font-title, serif); letter-spacing: 0.08em; text-transform: uppercase; color: var(--cx-gold-leaf, #e2b56a); }
.hk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(164px, 1fr)); gap: 5px; }
.hk-act {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 8px 4px 4px;
  border: 1px solid rgba(226, 181, 106, 0.16);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.025);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.hk-act:hover, .hk-act:focus-visible { border-color: rgba(226, 181, 106, 0.55); background: rgba(226, 181, 106, 0.07); outline: none; }
.hk-act.is-held { border-color: var(--cx-torch, #ff8a3d); box-shadow: 0 0 0 1px var(--cx-torch, #ff8a3d), 0 0 10px rgba(255, 138, 61, 0.4); }
.hk-act-icon {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 2px solid;
  border-color: #5a6068 #1d2024 #0d0e10 #3a3f46;
  border-radius: 3px;
  color: var(--cx-bone, #e8dcc0);
  background: radial-gradient(circle at 50% 42%, var(--a1, #66717c), rgba(0, 0, 0, 0) 78%), radial-gradient(circle at 38% 28%, #2b2f35, #17191d 56%, #08090a 100%);
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(122, 82, 41, 0.5);
}
.hk-act-icon .icon { width: 20px; height: 20px; }
.hk-act-icon [fill="currentColor"] { fill: url(#ei-glyph-bone); }
.hk-act-icon [stroke="currentColor"] { stroke: url(#ei-glyph-bone); }
.hk-act-name { flex: 1; min-width: 0; font: 400 14px/1.2 var(--cx-font-body, serif); color: var(--cx-text, #e8dcc0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* fixer-b (usability M11/L18): the button's own name on top, the full name small under it (cut there, never the name) */
.hk-act-full { display: block; font-size: 11px; line-height: 1.2; color: var(--cx-text-dim, #a89a80); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the books and buttons in the fold keep their names (compact hides the bar's names): wider sockets there, so each name fits
   whole at the 11 px floor */
.hud.compact .hk-fold { grid-template-columns: repeat(auto-fill, 58px); }
.hud.compact .hk-fold .ab-btn { width: 58px; }
.hud.compact .hk-fold .ab-name { display: block; }
.hk-act .codex-kbd { flex: none; font-size: 12px; }
.hk-act-nokey { flex: none; font: 400 12px/1 var(--cx-font-num, sans-serif); color: var(--cx-text-dim, #a89a80); }
.hk-act-off { position: absolute; top: 1px; right: 3px; font-size: 12px; color: var(--cx-torch, #ff8a3d); }
.hk-opts { display: flex; flex-direction: column; gap: 6px; }
.hk-opts--row { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; }
.hk-kb-cols { column-count: 2; column-gap: 22px; }
.hk-kb-sec { break-inside: avoid; -webkit-column-break-inside: avoid; }
.hk-kb-sec > .hk-h3:first-child { margin-top: 4px; }
.hk-opt { display: flex; align-items: baseline; gap: 8px; font: 400 15px/1.35 var(--cx-font-body, serif); color: var(--cx-text, #e8dcc0); cursor: pointer; }
.hk-opt input { accent-color: #c48a45; }
.hk-note { font-size: 13px; color: var(--cx-text-dim, #a89a80); }
.hk-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hk-btn { flex: none; }
.hk-msg { margin: 0 0 8px; padding: 6px 9px; border-radius: 3px; background: rgba(110, 196, 120, 0.12); color: #bfe8b8; font: 400 14px/1.35 var(--cx-font-body, serif); }
.hk-msg.is-bad { background: rgba(192, 57, 43, 0.16); color: #ffb3a6; }
.hk-conflict { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; padding: 8px 10px; border: 1px solid rgba(192, 57, 43, 0.5); border-radius: 4px; background: rgba(192, 57, 43, 0.12); font: 400 15px/1.35 var(--cx-font-body, serif); color: var(--cx-text, #e8dcc0); }
.hk-conflict > span { flex: 1 1 220px; }
.hk-kb { display: flex; flex-direction: column; }
.hk-kb-row { display: grid; grid-template-columns: minmax(0, 1fr) 74px 24px 46px; align-items: center; gap: 6px; padding: 3px 2px; border-bottom: 1px solid rgba(226, 181, 106, 0.08); }
.hk-kb-name { font: 400 14px/1.25 var(--cx-font-body, serif); color: var(--cx-text, #e8dcc0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hk-kb-key { height: 28px; padding: 0 6px; border: 1px solid rgba(226, 181, 106, 0.35); border-radius: 3px; background: rgba(0, 0, 0, 0.35); color: var(--cx-text, #e8dcc0); font: 400 13px/1 var(--cx-font-num, sans-serif); cursor: pointer; }
.hk-kb-key:hover { border-color: var(--cx-gold-leaf, #e2b56a); }
.hk-kb-key:disabled { cursor: default; opacity: 0.7; border-color: rgba(255, 255, 255, 0.1); }
.hk-kb-row.is-capture .hk-kb-key { border-color: var(--cx-torch, #ff8a3d); box-shadow: 0 0 0 1px var(--cx-torch, #ff8a3d), 0 0 10px rgba(255, 138, 61, 0.45); color: #fff3d6; }
.hk-kb-x { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--cx-text-dim, #a89a80); font: 700 16px/1 var(--cx-font-num, sans-serif); cursor: pointer; }
.hk-kb-x:hover { color: #ffb3a6; background: rgba(192, 57, 43, 0.18); }
.hk-kb-x.is-empty { cursor: default; }
.hk-kb-lock { width: 24px; height: 24px; display: grid; place-items: center; color: var(--cx-text-dim, #a89a80); }
.hk-kb-lock .icon { width: 13px; height: 13px; }
.hk-kb-row.is-fixed .hk-kb-name { color: var(--cx-text-dim, #a89a80); }
.hk-kb-def { white-space: nowrap; }
.hk-kb-why { grid-column: 1 / -1; margin: -1px 0 2px; font: italic 400 12px/1.3 var(--cx-font-body, serif); color: var(--cx-text-dim, #a89a80); white-space: normal; }   /* V7.3: why no key */

/* ================================================================== narrower windows, compact, reduced motion */
@media (max-width: 1179px) {
  .hk-book { width: calc(32px + 3px + var(--hk-thick, 0.35) * 9px); }
  .hk-bk-cover { width: 32px; }
  .hk-bk-edge { width: calc(3px + var(--hk-thick, 0.35) * 9px); }
  .hk-bk-name { width: 30px; font-size: 11px; letter-spacing: -0.04em; }
  .hk-book .ab-key { left: 24px; }
  .hk-books { padding: 5px 5px 4px; gap: 3px; }
}
@media (max-width: 1023px) {
  .hk-bk-name { display: none; }
  .hk-bk-title { transform: translateY(-50%); }
}
.hud.compact.hk-rows-2, .hud.compact.hk-rows-3 { --bar-top: 56px; }
.hud.compact .hk-stack, .hud.compact .hk-books { display: none !important; }
.hud.compact .ab > .hk-slot.hk-last { display: none; }
.hud.compact .hk-more { display: block; }
.hud:not(.compact) .hk-fold { display: none; }
@media (max-width: 700px) { .hk-kb-cols { column-count: 1; } }
@media (max-width: 560px), (max-height: 420px) {
  .hk-kb-row { grid-template-columns: minmax(0, 1fr) 84px 24px; }
  .hk-kb-def { display: none; }
  .hk-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}
body.reduced-motion .hk-bk-cover, body.reduced-motion .hk-ghost { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .hk-bk-cover { transition: none !important; } }

/* A closing book never catches a click: while the Letopis, the Nauka or the Azbuka falls shut (its layer has lost .is-open but
   is still fading out for ~0.5 s), a click or a drop on the bars under it reaches the bars (V7.2.4, found by HB1: a drag right
   after closing a book landed in the fading book). */
.book-layer:not(.is-open), .book-layer:not(.is-open) *, .nk-layer:not(.is-open), .nk-layer:not(.is-open) *,
.az-layer:not(.is-open), .az-layer:not(.is-open) * { pointer-events: none !important; }

/* V7.3 (lane S; docs/V7-3-UPDATES.md item 7, the user: "You should be able to click the Nauka, Azbuka and the third one … right next
 * to the hotbar"): the HUD lets clicks through to the world except where a part takes them (.hud .ab-plate …); the three books'
 * group was not one of them, so a click on a book fell through to the map. They take their clicks now. */
.hud .hk-books { pointer-events: auto; }

/* ================================================================== V7.3 (LATE-REQUESTS 15): one name everywhere
 * A socket shows its tab's or window's own name (Professions, Collections, Character, Quartermaster, Key bindings). The HUD's
 * fitSlotName (ui-hud.js) narrows a long name (never under 0.7, the 11 px floor stays) or, when that is not enough, puts it on
 * two lines at its space or its syllable break (a soft hyphen, shown only there), as the exam's "Problem / cleared" does. */
.ab-btn .ab-name.ab-two { white-space: normal; -webkit-hyphens: manual; hyphens: manual; line-height: 10px; bottom: 2px; letter-spacing: -0.01em; }

/* V7.4 lane H (v74-home): the buttons other files add (SQ.Hotbar.addAction). The cooldown is hud.css's real-cooldown wedge
 * (.oncd + --cdp, the minutes left in the middle); when it is ready again one soft warm glow, no flash and no sound. The
 * Ognik's ember glows while its trip runs. */
.ab-btn.hk-ready { animation: hkReady 2.4s ease-out 1; }
@keyframes hkReady { 0% { box-shadow: 0 0 0 0 rgba(255, 150, 60, 0); } 30% { box-shadow: 0 0 10px 2px rgba(255, 150, 60, 0.5); } 100% { box-shadow: 0 0 0 0 rgba(255, 150, 60, 0); } }
@media (prefers-reduced-motion: reduce) { .ab-btn.hk-ready { animation: none; } }
body.reduced-motion .ab-btn.hk-ready { animation: none; }
.ab-btn[data-slot="ognik"].active .ab-icon { filter: drop-shadow(0 0 4px rgba(255, 150, 60, 0.85)); }
/* V7.6 lane A (v76-bag): an item of the Torba on the bar with none left: grey (it is restocked at your next inn) */
.ab-btn.hk-dim .ab-icon, .mm-btn.hk-dim .ab-icon { filter: grayscale(1); opacity: 0.45; }
