.menu-btn {
  position: fixed;
  z-index: 30;
  left: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  transition: left var(--slide);
}
body.sidebar-open .menu-btn {
  left: calc(var(--sidebar-w) + 10px);
}
.menu-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.sidebar-open .menu-btn .bars,
body:not(.sidebar-open) .menu-btn .cross {
  display: none;
}

.scrim {
  display: none;
}

/* clear of the menu button, which sits at the map's top left either way */
.chip {
  position: absolute;
  left: 54px;
  top: 10px;
  z-index: 10;
  background: var(--surface-float);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 20px;
  font-size: 12.5px;
  max-width: min(60%, 560px);
}
/* the padding makes the line as tall as the menu button, so the two sit on
   one row */
.chip > .line,
.chip > button {
  display: block;
  padding: 6px 10px;
}
.chip > button {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  background: none;
  border: 0;
  border-radius: 7px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
@media (hover: hover) {
  .chip:has(> button:hover) {
    border-color: var(--accent);
  }
}
/* centred on the first line, however many the line wraps to */
#chipDot {
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.chip b {
  font-weight: 600;
}
.chip .sep {
  color: var(--dim);
  margin: 0 6px;
}
.chip .t {
  color: var(--warn);
}
/* the line alone sets the chip's width, and the note wraps within it */
.chip .note {
  color: var(--dim);
  font-size: 12px;
  margin: 0 10px;
  border-top: 1px solid var(--line);
  padding: 5px 0 6px;
  contain: inline-size;
}
/* a draft's overview in the note, which widens the chip as far as it goes */
.chip:has(.overview) {
  max-width: min(calc(100% - 64px), 460px);
}
.chip .note:has(.overview) {
  contain: none;
}
.chip .overview {
  line-height: 16px;
}
.chip .overview p {
  margin: 0;
}
.chip .overview .counts {
  margin-top: 2px;
}
.chip .overview .zero {
  opacity: 0.7;
}
.chip .overview .over {
  color: #ff7b7b;
}
.chip .overview .high {
  color: var(--warn);
}
.chip .overview .findings {
  margin: 4px 0 0;
  padding-left: 16px;
  max-height: 30vh;
  overflow: auto;
}
.chip .overview .findings .error {
  color: var(--warn);
}
.chip .overview .there {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
/* a fold in the note, whichever note it stands in */
.chip .more {
  margin-top: 2px;
}
.chip .more > summary {
  cursor: pointer;
}
/* the note of a level from elsewhere: who made it, their words and the ways to keep it */
.chip .shared p {
  margin: 0;
}
.chip .shared .notes {
  white-space: pre-line;
  max-height: 30vh;
  overflow: auto;
}
.chip .shared .members {
  margin: 4px 0 0;
  padding-left: 16px;
  max-height: 30vh;
  overflow: auto;
}
.chip .shared .members a {
  color: var(--accent);
  text-underline-offset: 2px;
}
.chip .shared .members a[aria-current="true"] {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

/* bottom left, above the band the scale bar is drawn in */
.tools {
  position: absolute;
  left: 12px;
  bottom: var(--corner-foot);
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 24px);
  background: var(--surface-float);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 8px;
  font-size: 12.5px;
}
.tools button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 6px;
  padding: 3px 9px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
@media (hover: hover) {
  .tools button:hover {
    border-color: var(--accent-dim);
  }
}
.tools button[aria-pressed="true"] {
  background: var(--accent);
  color: #06222f;
  border-color: var(--accent);
}
.tools button:disabled {
  opacity: 0.4;
  cursor: default;
}
.tools .status {
  flex-basis: 100%;
  color: var(--warn);
  font-size: 11.5px;
  contain: inline-size;
}
.tools .status:empty {
  display: none;
}
.tools .status.dying {
  color: #ff7b7b;
}

/* the planner's strip stands above the editor's wherever both show, and
   while editing keeps only the line that says so */
#course {
  bottom: calc(var(--corner-foot) + var(--under-h, 0px));
}
#course .line {
  flex: 1 1 0;
  min-width: 0;
}
#course .status.hint {
  color: var(--dim);
}
body.editing #course > :not(.status) {
  display: none;
}
body.editing #course .status {
  flex-basis: auto;
  contain: none;
}
.tools .warn {
  color: var(--warn);
  border-color: var(--warn);
}
