/* The dock: Timeline and Journal in a floating glass pill; the open section glows a soft cyan.
   Signed in, a cyan dot opens the owner's menu. While editing, the editor's bar takes the dock's place. */
.tabs {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: none;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 12px 30px -12px var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  transform: translateX(-50%);
  animation: dockIn 0.7s 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

#app.is-open ~ .tabs {
  display: flex;
}

#app.is-open[data-view="login"] ~ .tabs {
  display: none;
}

@keyframes dockIn {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
}

.tabs button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--ink-2);
  padding: 11px 22px;
  border-radius: 999px;
  font: 500 14px/1 var(--sans);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.tabs button:hover {
  color: var(--ink);
}

.tabs button[aria-selected="true"] {
  background: var(--cyan-soft);
  color: var(--cyan-ink);
  box-shadow: inset 0 0 0 1px var(--cyan-edge);
}

/* the editor's bar */
.ebar {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: none;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 12px 30px -12px var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  transform: translateX(-50%);
  animation: dockIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

#app.editing ~ .tabs {
  display: none !important;
}

#app.editing ~ .ebar {
  display: flex;
}

#app.editing footer {
  display: none;
}

.ebar button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--ink-2);
  padding: 11px 18px;
  border-radius: 999px;
  font: 500 14px/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.ebar button:hover {
  color: var(--ink);
}

.ebar .pri {
  background: var(--cyan-soft);
  color: var(--cyan-ink);
  box-shadow: inset 0 0 0 1px var(--cyan-edge);
}

.ebar .pri:hover {
  color: var(--cyan-ink);
}

.ebar .warn,
.ebar .warn:hover {
  color: var(--warn);
}

/* the owner's dot and its menu */
.tabs-in {
  display: flex;
  gap: 2px;
}

.tabs .ob {
  display: grid;
  place-items: center;
  width: 40px;
  padding: 0;
  margin-left: 12px;
  position: relative;
}

/* the divider sits in the middle of the room between the tabs and the owner's dot */
.tabs .ob::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--glass-edge);
}

.tabs .ob i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px var(--cyan-soft), 0 0 10px var(--cyan);
  animation: obp 3.4s ease-in-out infinite;
}

.tabs .ob[aria-expanded="true"] {
  background: var(--cyan-soft);
}

@keyframes obp {
  50% {
    box-shadow: 0 0 0 6px var(--cyan-soft), 0 0 4px var(--cyan);
  }
}

.om {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 248px;
  padding: 8px;
  border-radius: 18px;
  background: var(--menu-bg);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 18px 40px -16px var(--glass-shadow);
  transform-origin: bottom right;
  animation: ddIn 0.18s ease-out;
}

.tabs .om button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
  font: 500 14px/1.2 var(--sans);
  color: var(--ink-2);
}

.tabs .om button:hover,
.tabs .om button:focus-visible {
  background: var(--cyan-soft);
  color: var(--ink);
  outline: none;
}

.om svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--cyan-ink);
}

.om span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.om small {
  font-size: 12px;
  font-weight: 400;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.om hr {
  border: 0;
  height: 1px;
  background: var(--edge);
  margin: 8px 12px;
  width: auto;
}
