/* Shared components used on several screens: buttons, chips, tab bar, toast, quick-exit. */

.tabs {
  transition:
    background-color 0.25s,
    color 0.25s;
  display: flex;
  gap: 2px;
  margin: 0 12px calc(10px + env(safe-area-inset-bottom, 0px));
  padding: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 22px;
  overflow: visible;
  align-items: flex-end;
}

.iconbtn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border-radius: 999px;
  padding: 15px;
  font-size: 15.5px;
  font-weight: 500;
  border: 1.5px solid var(--line);
  background: var(--surface);
  min-height: 52px;
  border-color: transparent;
}

.btn.primary {
  box-shadow: var(--shadow);
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--ground);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 20;
  max-width: 85%;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.toast.show {
  opacity: 1;
}

.note {
  font-size: 12.5px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  color: var(--ink-soft);
}

.fine {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.tabs button {
  background: none;
  border: none;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11.5px;
  padding: 8px 2px;
  flex: 1;
  min-width: 0;
  min-height: 52px;
  border-radius: 16px;
}

.tabs button svg {
  width: 22px;
  height: 22px;
}

.tabs button.on {
  font-weight: 600;
  background: var(--tab-on);
  color: var(--ink);
}

.tabs button.on svg {
  color: var(--tab-on-icon);
}

.tabs button.sos {
  flex: 0 0 66px;
  width: 66px;
  height: 66px;
  min-height: 66px;
  margin: -28px 4px 0;
  padding: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #18214a;
  border: 5px solid var(--ground);
  box-shadow: 0 10px 20px -8px rgba(24, 33, 74, 0.6);
  justify-content: center;
  gap: 0;
  font-size: 10.5px;
  font-weight: 700;
}

.dots {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.dots i {
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: var(--line);
}

.dots i.on {
  width: 22px;
  background: var(--info);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
}

.acts {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  border-radius: 999px;
  padding: 9px 14px;
  min-height: 40px;
  border: 1.5px solid var(--pink-line);
  background: var(--pink-soft);
  border-color: var(--pink-line);
}

.chip.fill {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 2px;
}

.typing-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-soft);
  animation: blink 1s infinite;
}

.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

.badge {
  display: inline-block;
  font-size: 11.5px;
  border-radius: 999px;
  padding: 1px 10px;
  background: var(--info-soft);
  margin-top: 5px;
  color: var(--ink);
}

.avail {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #1e7a45;
}

.avail i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2e9e5b;
}

.avail.busy {
  color: var(--ink-soft);
}

.avail.busy i {
  background: var(--ink-soft);
}

.tabs button.sos.on {
  flex: 0 0 66px;
  width: 66px;
  height: 66px;
  min-height: 66px;
  margin: -28px 4px 0;
  padding: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #18214a;
  border: 5px solid var(--ground);
  box-shadow: 0 10px 20px -8px rgba(24, 33, 74, 0.6);
  justify-content: center;
  gap: 0;
  font-size: 10.5px;
  font-weight: 700;
  outline: 3px solid var(--primary);
  outline-offset: 0;
}

.qx {
  position: absolute;
  /* floating at the bottom-left, just above the tab bar so it never covers the tabs */
  left: 14px;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 10px 22px -8px rgba(24, 33, 74, 0.6);
}

.qx svg {
  color: var(--pink);
}

.app[data-cur="chat"] .qx {
  display: none;
}

/* keeps a centred header title clear of the quick-exit button in the corner */
.qx-room {
  flex-shrink: 0;
  width: 104px;
}

/* the intro's "skip" sits in the header corner, and the intro has no tab bar: the button goes below */
.app[data-cur="intro"] .qx {
  top: auto;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.iconbtn.xbtn {
  background: var(--primary);
  color: var(--pink);
}

.app[data-cur="welcome"] .qx,
.app[data-cur="country"] .qx,
.app[data-cur="disguise"] .qx {
  display: none;
}

.tabs button.sos svg {
  width: 24px;
  height: 24px;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

.badge-flat {
  margin: 0;
}

/* "Emergency and support" tab: one tab for two screens, always a little louder than the others. */
.tabs button.urgent:not(.on) {
  color: var(--primary);
  font-weight: 600;
}

.tabs button.urgent:not(.on) svg {
  color: var(--accent); /* the emergency entry keeps its gold mark */
}

/* Two-way switch at the top of the emergency and support screens. */
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.seg button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-soft);
  font-size: 14px;
}

.seg button.on {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}
