/* --- Reset (минимальный) --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: #fff;
  color: #000;
  font-family: system-ui, sans-serif;
}

/* --- App Root --- */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* --- DOT --- */
#dot {
  position: fixed;
  right: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  background: #000;
  border-radius: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 1000;
  touch-action: none; /* важно для свайпов */
}

/* --- All containers hidden by default --- */
#search,
#dialogs,
#chat,
#functions,
#profile {
  display: none;
  position: absolute;
  inset: 0;
}

/* --- State-driven visibility --- */
#app[data-state="dialogs"] #dialogs {
  display: block;
}

#app[data-state="search"] #search {
  display: block;
}

#app[data-state="chat"] #chat {
  display: block;
}

#app[data-state="functions"] #functions {
  display: block;
}

#app[data-state="profile"] #profile {
  display: block;
}

/* --- Chat input zone skeleton --- */
#chat {
  padding-bottom: 64px; /* место под input */
}

#chat .input-zone {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  border-top: 1px solid #000;
  display: flex;
  align-items: center;
  padding: 8px;
  gap: 8px;
  background: #fff;
}

#chat input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
}

#chat button {
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
}
/* --- DOT base motion --- */
#dot {
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

/* --- IDLE --- */
#app[data-state="idle"] #dot {
  transform: translateY(-50%) scale(1);
  opacity: 1;
}

/* --- DIALOGS: slight drift down --- */
#app[data-state="dialogs"] #dot {
  transform: translateY(calc(-50% + 24px)) scale(1);
}

/* --- SEARCH: pull left, focus --- */
#app[data-state="search"] #dot {
  transform: translate(-12px, -50%) scale(0.9);
}

/* --- CHAT: dot becomes secondary, sinks down --- */
#app[data-state="chat"] #dot {
  transform: translateY(calc(-50% + 160px)) scale(0.8);
  opacity: 0.7;
}

/* --- FUNCTIONS: subtle emphasis --- */
#app[data-state="functions"] #dot {
  transform: translateY(calc(-50% - 24px)) scale(1.05);
}

/* --- PROFILE: retreat --- */
#app[data-state="profile"] #dot {
  transform: translateY(-50%) scale(0.75);
  opacity: 0.5;
}
