/* The help panel (partials/help_panel.html) and the header button that opens
   it. Tokens from app.css; blue only on the open state of the button, which
   is the "you are here" dot for the panel. 44px targets on touch: the panel
   is used from the iPad too. */
.help-open {
  margin-left: auto;
  flex: 0 0 auto;
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: var(--ink-dim);
  cursor: pointer;
}
.session-chip + .help-open { margin-left: .2rem; }
.help-open:hover { color: var(--ink); }
.help-open.is-open { color: var(--chrome); }
.help-open .icon { width: 20px; height: 20px; }
/* 32px under a mouse keeps the header slim; touch gets its 44pt back. */
@media (pointer: coarse) { .help-open { width: 44px; height: 44px; } }

.help-panel {
  position: fixed; top: 64px; right: 1rem;
  width: min(420px, calc(100vw - 2rem));
  max-height: calc(100vh - 80px);
  display: flex; flex-direction: column;
  background: var(--g2); border: 1px solid var(--line-strong);
  box-shadow: 0 12px 36px rgba(0,0,0,.5);
  z-index: 150;
}
.help-panel[hidden] { display: none; }
/* app.css gives every button display:inline-flex, which beats the hidden
   attribute: Flag and Clear showed on an empty thread. */
.help-panel [hidden] { display: none; }
.help-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .3rem .4rem .3rem .9rem; border-bottom: 1px solid var(--line);
}
.help-title { margin: 0; }
.help-close { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.help-thread {
  flex: 1 1 auto; overflow: auto; min-height: 120px;
  padding: .8rem .9rem; display: flex; flex-direction: column; gap: .7rem;
}
.help-msg { margin: 0; white-space: pre-wrap; line-height: 1.45; font-size: .92rem; }
.help-msg.you { color: var(--ink-dim); border-left: 2px solid var(--line-strong); padding-left: .6rem; }
.help-msg.err { color: var(--warn); }
/* An answer is markdown help.js has turned into blocks (vault/47 A3). */
.help-msg.answer { white-space: normal; }
.help-msg.answer > p, .help-msg.answer > ol, .help-msg.answer > ul { margin: 0 0 .55em; }
.help-msg.answer > :last-child { margin-bottom: 0; }
.help-msg.answer ol, .help-msg.answer ul { padding-left: 1.3em; }
.help-msg.answer li + li { margin-top: .3em; }
.help-msg.answer code { font-family: var(--mono, ui-monospace, monospace); font-size: .88em; }
.help-intro { margin: 0; font-size: .85rem; }
.help-form {
  border-top: 1px solid var(--line); padding: .6rem .9rem .7rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.help-form textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 44px;
  background: var(--g1); color: var(--ink); border: 1px solid var(--line);
  padding: .5rem .6rem; font: inherit; font-size: .92rem;
}
.help-form textarea:focus { outline: none; border-color: var(--chrome); }
.help-actions { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.help-actions .btn { min-height: 44px; min-width: 72px; }
.help-actions .linklike { min-height: 44px; }
.help-status { margin-left: auto; font-size: .75rem; }
@media (max-width: 600px) {
  .help-panel {
    top: auto !important; bottom: 0; right: 0; left: 0;
    width: auto; max-height: 70vh; border-left: 0; border-right: 0;
  }
}
