/* 0.8.9. Chat, potions and spells share one dock; F stays beside K.
   Keep this after the legacy layout sheets. No gameplay behavior lives here. */
.action-dock {
  --slot-height: 60px;
  position: absolute;
  left: max(24px, env(safe-area-inset-left));
  right: max(205px, calc(env(safe-area-inset-right) + 190px));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: clamp(150px, 14vw, 210px) 54px minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  pointer-events: none;
  z-index: 3;
}
.action-dock .chat-wrap { position: relative; inset: auto; width: auto; min-width: 0; transform: none; }
.action-dock .chat-log { max-height: 82px; }
.action-dock .quickbar { position: static; inset: auto; transform: none; display: flex; flex-direction: column; align-self: start; gap: 4px; }
.action-dock .quickbar > button { width: 54px; min-width: 0; height: var(--slot-height); padding: 3px; box-sizing: border-box; }
.action-dock .spellbar { position: relative; inset: auto; transform: none; width: 100%; max-width: none; min-width: 0; display: flex; flex-direction: row; align-items: stretch; gap: 6px; }
.action-dock .hotbar-viewport { pointer-events: auto; }
.action-dock .hotbar-slots { width: 100%; min-width: 548px; grid-template-columns: repeat(12, minmax(42px, 1fr)); gap: 4px; }
.action-dock .spellbar .hotbar-slot { height: var(--slot-height); width: 100%; }
.action-dock .hotbar-toolbar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; order: 0; height: auto; flex-shrink: 0; }
.action-dock .book-favorite-controls { display: flex; flex-direction: row; align-items: stretch; gap: 4px; }
.action-dock .spellbar #bookSpell, .action-dock #abilityButton { position: relative; inset: auto; min-height: 0; height: var(--slot-height); padding: 3px; box-sizing: border-box; }
.action-dock .spellbar #bookSpell { width: 42px; min-width: 42px; font-size: 10px; }
.action-dock #abilityButton { width: 66px; min-width: 0; }
.action-dock #abilityButton > span { line-height: 28px; }
.action-dock #abilityName { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.action-dock .spellbar .hotbar-pages { position: static; inset: auto; flex-direction: row; gap: 3px; height: 25px; }
.action-dock .spellbar .hotbar-pages button { min-height: 25px; min-width: 28px; }
.action-dock .hotbar-pages output { min-width: 26px; text-align: center; }
/* Only individual status buttons and the opened description capture clicks. */
#effectsPanel {
  top: max(118px, calc(env(safe-area-inset-top) + 106px)); bottom: auto;
  left: 350px; right: 250px; width: auto; max-width: none; transform: none;
  background: none; border: 0; border-radius: 0; padding: 0;
  box-shadow: none; backdrop-filter: none; pointer-events: none; z-index: 5;
}
#effectsPanel .effects-row { pointer-events: none; }
#effectsPanel .effects-strip { width: 100%; padding: 0 0 3px; background: none; scrollbar-color: #aabf8b transparent; pointer-events: none; }
#effectsPanel .effect-chip { pointer-events: auto; min-height: 28px; box-shadow: 0 2px 5px #0005; }
#effectsPanel #targetEffects .effect-chip::before { content: 'Cel · '; opacity: .8; }
#effectsPanel .effect-detail { top: calc(100% + 6px); bottom: auto; max-height: min(200px, 35vh); overflow-y: auto; pointer-events: auto; }
#controlTip, .game-ui:has(.effects-panel:not([hidden])) #controlTip { bottom: 160px; }
@media (min-width: 701px) and (max-width: 1100px) and (min-height: 541px) {
  .action-dock { --slot-height: 54px; left: 12px; right: 205px; grid-template-columns: 145px 50px minmax(0, 1fr); gap: 6px; }
  .action-dock .quickbar > button { width: 50px; }
  #effectsPanel { left: 292px; right: 205px; top: 112px; }
  .notice-feed { bottom: 160px; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .action-dock {
    --slot-height: 53px;
    left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
    bottom: max(128px, calc(env(safe-area-inset-bottom) + 116px));
    grid-template-columns: minmax(0, 1fr); gap: 6px;
  }
  .action-dock .chat-wrap { grid-row: 1; }
  .action-dock .chat-log { display: none; position: absolute; left: 0; right: 0; bottom: calc(100% + 4px); max-height: min(110px, 18vh); }
  .action-dock .chat-wrap.writing .chat-log { display: block; }
  .action-dock .quickbar { grid-row: 2; flex-direction: row; height: 44px; gap: 4px; }
  .action-dock .quickbar > button { width: 46px; height: 44px; }
  .action-dock .quickbar > button > span { font-size: 21px; line-height: 22px; }
  .action-dock .quickbar > button small { font-size: 7px; }
  .action-dock .spellbar { grid-row: 3; }
  .action-dock .hotbar-slots { min-width: 584px; grid-template-columns: repeat(12, minmax(45px, 1fr)); }
  .action-dock .hotbar-toolbar { position: absolute; right: 0; bottom: calc(100% + 6px); height: 44px; flex-direction: row; align-items: center; gap: 4px; }
  .action-dock .spellbar #bookSpell, .action-dock #abilityButton { height: 44px; }
  .action-dock .spellbar #bookSpell { width: 39px; min-width: 39px; font-size: 9px; }
  .action-dock #abilityButton { width: 60px; }
  .action-dock #abilityIcon img { width: 22px; height: 22px; }
  .action-dock #abilityButton > span { line-height: 23px; }
  .action-dock .spellbar .hotbar-pages { height: 30px; gap: 2px; }
  .action-dock .spellbar .hotbar-pages button { min-width: 25px; min-height: 30px; padding: 0 3px; }
  .action-dock .hotbar-pages output { min-width: 22px; font-size: 9px; }
  #effectsPanel { top: max(140px, calc(env(safe-area-inset-top) + 128px)); left: 12px; right: 12px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; }
  #effectsPanel:has(#ownEffectsRow[hidden]), #effectsPanel:has(#targetEffectsRow[hidden]) { grid-template-columns: minmax(0, 1fr); }
  #effectsPanel .effect-chip { font-size: 9px; min-height: 25px; padding: 2px 6px; }
  #effectsPanel .effects-row + .effects-row { margin-top: 0; }
  .game-ui:has(#effectsPanel:not([hidden])) .world-status { top: 172px; }
  .game-ui:has(#effectsPanel:not([hidden])) .minimap-card { top: 172px; }
  .game-ui:has(#effectsPanel:not([hidden])) .pvp-bar { top: 246px; }
  .game-ui:has(#effectsPanel:not([hidden])) .quest-tracker { top: 289px; }
  #controlTip, .game-ui:has(.effects-panel:not([hidden])) #controlTip { bottom: 340px; max-width: calc(100% - 24px); }
  .notice-feed { bottom: 355px; }
  .game-ui:has(#chatForm:not([hidden])) #effectsPanel { visibility: visible; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .action-dock {
    --slot-height: 44px;
    left: max(112px, env(safe-area-inset-left)); right: max(151px, calc(env(safe-area-inset-right) + 140px));
    bottom: max(10px, env(safe-area-inset-bottom)); grid-template-columns: 44px minmax(0, 1fr); gap: 5px;
  }
  .action-dock .chat-wrap { grid-column: 1 / -1; width: 170px; max-width: 100%; }
  .action-dock .chat-log { display: none; position: absolute; bottom: calc(100% + 3px); left: 0; right: 0; max-height: 90px; }
  .action-dock .chat-wrap.writing .chat-log { display: block; }
  .action-dock .chat-button { padding: 4px 7px; font-size: 9px; }
  .action-dock .quickbar { grid-column: 1; grid-row: 2; }
  .action-dock .quickbar > button { width: 44px; }
  .action-dock .quickbar > button > span { font-size: 20px; line-height: 23px; }
  .action-dock .quickbar > button small { font-size: 7px; }
  .action-dock .spellbar { grid-column: 2; grid-row: 2; }
  .action-dock .hotbar-slots { min-width: 478px; grid-template-columns: repeat(12, minmax(38px, 1fr)); gap: 2px; }
  .action-dock .hotbar-toolbar { position: absolute; right: 0; bottom: calc(100% + 5px); flex-direction: row; align-items: center; gap: 3px; height: 32px; }
  .action-dock .spellbar #bookSpell { width: 34px; min-width: 34px; height: 32px; font-size: 8px; }
  .action-dock #abilityButton { width: 58px; height: 32px; }
  .action-dock #abilityButton > span { line-height: 16px; height: 18px; }
  .action-dock #abilityIcon img { width: 18px; height: 18px; }
  .action-dock #abilityName { font-size: 6px; }
  .action-dock .spellbar .hotbar-pages button { min-height: 24px; }
  #effectsPanel { top: 90px; left: 242px; right: 155px; }
  #effectsPanel .effect-chip { font-size: 9px; min-height: 24px; padding: 1px 5px; }
  #controlTip, .game-ui:has(.effects-panel:not([hidden])) #controlTip { bottom: 155px; }
  .notice-feed { top: 154px; bottom: auto; left: auto; right: 15px; width: min(300px, calc(100% - 395px)); max-height: min(70px, calc(100vh - 294px)); overflow: hidden; }
}

/* In short portrait view the tracked quest remains a clickable title, rather
   than covering the chat and potion row. Full details stay in the journal. */
@media (max-width: 700px) and (max-height: 740px) and (orientation: portrait) {
  .quest-tracker { padding: 6px 9px; gap: 0; }
  .quest-tracker > span { display: none; }
  .quest-tracker strong { font-size: 14px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* 0.8.17: queued F command is accepted, not disabled by the shared action. */
.action-dock #abilityButton.queued { outline: 2px solid var(--gold); filter: none; }
