* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--tg-theme-text-color, #000000);
  background-color: var(--tg-theme-bg-color, #ffffff);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#react-app {
  min-height: 100vh;
  padding: 16px;
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 16px 0;
  font-weight: 600;
  color: var(--tg-theme-text-color, #000000);
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 18px;
}

p {
  margin: 0 0 12px 0;
  color: var(--tg-theme-text-color, #000000);
}

ul, ol {
  margin: 0 0 16px 0;
  padding-left: 24px;
}

li {
  margin-bottom: 8px;
}

form {
  width: 100%;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--tg-theme-text-color, #000000);
}

input[type=text],
input[type=email],
input[type=number],
input[type=password],
textarea,
select {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--tg-theme-hint-color, #999999);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  background-color: var(--tg-theme-bg-color, #ffffff);
  color: var(--tg-theme-text-color, #000000);
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--tg-theme-button-color, #3390ec);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

input[type=checkbox] {
  width: auto;
  margin-right: 8px;
  margin-bottom: 0;
  cursor: pointer;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background-color: var(--tg-theme-button-color, #3390ec);
  color: var(--tg-theme-button-text-color, #ffffff);
  transition: opacity 0.2s;
  width: 100%;
  margin-bottom: 12px;
}

button:hover:not(:disabled) {
  opacity: 0.9;
}

button:active:not(:disabled) {
  opacity: 0.8;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background-color: transparent;
  color: var(--tg-theme-button-color, #3390ec);
  border: 1px solid var(--tg-theme-button-color, #3390ec);
}

.error {
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  background-color: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
}

.success {
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  background-color: rgba(52, 199, 89, 0.1);
  color: #34c759;
}

.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--tg-theme-hint-color, #999999);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.loading .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--tg-theme-hint-color, rgba(0, 0, 0, 0.1));
  border-top: 4px solid var(--tg-theme-button-color, #3390ec);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

.top-menu {
  position: sticky;
  top: 0;
  background-color: var(--tg-theme-bg-color, #ffffff);
  border-bottom: 1px solid var(--tg-theme-hint-color, #e0e0e0);
  margin: -16px -16px 20px -16px;
  padding: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.menu-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.menu-item {
  flex: 1;
  min-width: 0;
  display: flex;
}

.menu-link {
  display: block;
  padding: 12px 4px;
  text-align: center;
  text-decoration: none;
  color: var(--tg-theme-hint-color, #999999);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: normal;
  font-size: 12px;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.3;
  word-wrap: break-word;
  hyphens: auto;
}

@media (max-width: 400px) {
  .menu-link {
    font-size: 11px;
    padding: 10px 3px;
  }
}
@media (max-width: 360px) {
  .menu-link {
    font-size: 10px;
    padding: 10px 2px;
    line-height: 1.2;
  }
}
@media (max-width: 320px) {
  .menu-link {
    font-size: 9px;
    padding: 8px 2px;
  }
}
.menu-link:hover {
  color: var(--tg-theme-text-color, #000000);
  background-color: var(--tg-theme-hint-color, rgba(0, 0, 0, 0.05));
}

.menu-link.active {
  color: var(--tg-theme-button-color, #3390ec);
  border-bottom-color: var(--tg-theme-button-color, #3390ec);
}

.member-list {
  list-style: none;
  padding: 0;
}

.member-item {
  padding: 12px;
  border-bottom: 1px solid var(--tg-theme-hint-color, #e0e0e0);
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-item:last-child {
  border-bottom: none;
}

.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--tg-theme-button-color, #3390ec);
}

.member-avatar img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
}

a {
  color: var(--tg-theme-link-color, #3390ec);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}