/* Mobile-only Watch & Chat. The original desktop dock and game art stay intact. */
.ale-pub-window-actions { display:flex; align-items:center; gap:6px; }
.ale-pub-mobile-action, .ale-pub-mobile-unread { display:none; }

@media (max-width:900px) {
  body.pub-watch-active { overflow:hidden; }
  /* Council remains in More; its fixed rail must not cover chat controls. */
  body.pub-watch-active .seven-ribbon { display:none; }
  body.pub-watch-active #app:not([hidden]) {
    position:fixed; z-index:41; inset:var(--pub-viewport-top,0px) 0 auto; width:100%;
    height:var(--pub-page-height); min-height:0; overflow-y:auto; overflow-x:hidden;
    overscroll-behavior:contain; scrollbar-width:thin; scroll-padding-top:84px;
  }
  body.pub-watch-active .workspace { min-height:0; padding-bottom:24px; }
  /* Expanded chat has no page pane. Remove its concealed controls from Tab
     order, but keep urgent mining/Raven cues and bottom navigation available. */
  body.pub-watch-active:has(.ale-pub-dialog[data-mobile-mode="expanded"]) .workspace > :not(#miningWarning):not(#ravenArrival) { visibility:hidden; }
  body.pub-watch-active.mine-impact .app { animation:none; }
  body.pub-watch-active .mobile-bottom-nav { top:auto; bottom:var(--pub-viewport-bottom,0px); transform:none; }
  body.pub-watch-active .mobile-more-sheet {
    top:auto; transform:none;
    bottom:calc(var(--pub-viewport-bottom,0px) + var(--pub-nav-height,70px) + 6px);
    max-height:calc(var(--pub-viewport-height,100dvh) - var(--pub-nav-height,70px) - 16px);
    overflow-y:auto; overscroll-behavior:contain;
  }
  body.pub-watch-active .ale-pub-dialog[open] {
    inset:var(--pub-panel-top) 0 auto; width:100%; max-width:100%;
    height:var(--pub-panel-height); max-height:var(--pub-panel-height); min-height:0;
    overflow:hidden; border:0; border-top:1px solid #d6aa65; border-radius:14px 14px 0 0;
    box-shadow:0 -6px 22px #0006; isolation:isolate;
  }
  body.pub-watch-active .ale-pub-mobile-action {
    display:inline-flex; align-items:center; justify-content:center; flex:none;
    min-width:44px; min-height:44px; padding:6px 8px; border:1px solid #d0a76750;
    border-radius:5px; background:#1b1523; color:#f5d39f; font:inherit; font-size:.7rem; font-weight:800;
    cursor:pointer;
  }
  body.pub-watch-active .ale-pub-mobile-action:hover { border-color:#f5d39f; }
  body.pub-watch-active .ale-pub-mobile-unread:not([hidden]) {
    display:grid; place-items:center; min-width:22px; height:22px; padding:0 5px;
    border-radius:12px; background:#f3bb65; color:#251307; font-size:.7rem; font-weight:900;
  }
  body.pub-watch-active .ale-pub-dialog .ale-pub-header { align-items:center; gap:6px; padding:6px 10px; min-height:56px; }
  body.pub-watch-active .ale-pub-dialog .ale-pub-brand { gap:6px; }
  body.pub-watch-active .ale-pub-dialog .ale-pub-mug { display:none; }
  body.pub-watch-active .ale-pub-dialog .ale-pub-header h2 { font-size:1.2rem; white-space:nowrap; }
  body.pub-watch-active .ale-pub-dialog .ale-pub-eyebrow,
  body.pub-watch-active .ale-pub-dialog .ale-pub-tagline { display:none; }
  body.pub-watch-active .ale-pub-dialog .ale-pub-close { border:0; border-radius:5px; font-size:1.6rem; }

  /* Compact mode keeps nearby knights visible without expanding the chat. */
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-body { overflow:hidden; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-about,
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-muted,
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] #alePubSound,
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] #alePubTestAlerts { display:none; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-statusbar { padding:0 10px 4px; min-height:20px; gap:4px; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-status { font-size:.62rem; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-vein { font-size:.6rem; margin-left:auto; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-status-actions:has(#alePubReconnect[hidden]) { display:none; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-nearby { margin:0 8px 4px; padding:0 5px 3px; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-nearby summary { min-height:24px; font-size:.65rem; line-height:24px; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-nearby summary span { min-width:20px; margin-left:3px; padding:0 4px; line-height:17px; font-size:.65rem; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-nearby p { margin:0; font-size:.62rem; line-height:1.3; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-nearby:has(li) p { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-nearby ul { flex-wrap:nowrap; max-height:48px; gap:6px; overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; scrollbar-width:thin; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-nearby li { flex:none; max-width:220px; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-knight { min-height:44px; padding:5px 7px; font-size:.7rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-conversation { min-height:0; height:auto; flex:1; margin:0 8px 4px; border:0; }
  /* Extremely short/keyboard viewports scroll the names and feed together,
     instead of squeezing the conversation to an unreadable sliver. */
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"][data-keyboard="true"] .ale-pub-body { overflow-y:auto; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"][data-keyboard="true"] .ale-pub-conversation { flex:1 0 64px; min-height:64px; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-messages { padding:0 2px; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-message { padding:5px 8px; margin-bottom:5px; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-message p { margin-top:2px; font-size:.8rem; line-height:1.4; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-message strong { font-size:.68rem; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-mute { display:none; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-empty { padding:4px; gap:2px; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-empty > span { display:none; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-empty strong { font-size:1rem; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-empty p { font-size:.65rem; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-form {
    display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:3px 8px; padding:7px 10px;
  }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-form > label,
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-keyboard-hint,
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] #alePubCount {
    position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap;
  }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] #alePubClear { display:none; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-form textarea {
    min-height:44px; max-height:72px; height:44px; resize:none; padding:10px; font-size:16px; line-height:22px;
  }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-compose-footer { padding:0; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-send { min-width:65px; min-height:44px; padding:8px 10px; box-shadow:none; border-radius:5px; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-notice { grid-column:1/-1; margin:0; font-size:.65rem; line-height:1.3; max-height:2.6em; overflow-y:auto; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="minimized"] .ale-pub-clink-footer,
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="minimized"] .ale-pub-body,
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="minimized"] .ale-pub-form,
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="minimized"] #alePubMinimize { display:none; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="expanded"] .ale-pub-body { min-height:0; }
  body.pub-watch-active .ale-pub-clink-footer { padding:4px 10px; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-clink-footer > button { display:none; }
  body.pub-watch-active .ale-pub-clink-footer .ale-pub-notice { font-size:.65rem; line-height:1.3; max-height:2.6em; overflow:auto; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="expanded"] .ale-pub-form { padding:8px 12px; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="expanded"] .ale-pub-form textarea { min-height:44px; }
  body.pub-watch-active .ale-pub-dialog[data-keyboard="true"] .ale-pub-keyboard-hint { display:none; }
  body.pub-watch-active:has(.ale-pub-dialog[data-keyboard="true"][data-mobile-mode="compact"]) .topbar { display:none; }
}
@media (max-width:900px) and (max-height:480px) {
  body.pub-watch-active .topbar { position:static; min-height:60px; padding-block:8px; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-body { overflow-y:auto; }
  body.pub-watch-active .ale-pub-dialog[data-mobile-mode="compact"] .ale-pub-conversation { flex:1 0 64px; min-height:64px; }
}
