.telegram-access-modal {
  width: min(1180px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  overflow: auto;
}

.telegram-access-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 12px;
}

.telegram-access-search {
  width: min(520px, 100%);
}

.telegram-access-table-wrap {
  overflow: auto;
  border: 1px solid #d9e1dd;
}

.telegram-access-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.telegram-access-table th,
.telegram-access-table td {
  padding: 12px;
  border-bottom: 1px solid #e2e7e4;
  text-align: left;
  vertical-align: middle;
}

.telegram-access-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f7f5;
}

.telegram-access-note {
  min-width: 220px;
  max-width: 360px;
  white-space: normal;
}

.access-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid;
  font-size: 13px;
  font-weight: 600;
}

.access-status.active {
  color: #08634c;
  border-color: #9bc8ba;
  background: #e8f5f0;
}

.access-status.inactive {
  color: #6b7470;
  border-color: #cbd2ce;
  background: #f1f3f2;
}

.telegram-access-message {
  min-height: 22px;
  margin-bottom: 8px;
}

.telegram-access-message.loading {
  color: #4f5d57;
}

.telegram-access-empty {
  padding: 28px !important;
  color: #63706a;
  text-align: center !important;
}

.telegram-access-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(18 28 24 / 45%);
}

.telegram-access-editor-modal {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.telegram-access-toggle {
  align-self: end;
  min-height: 44px;
}

.telegram-id-field {
  grid-column: 1 / -1;
}

.telegram-id-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
}

.telegram-id-controls input,
.telegram-id-controls button {
  min-height: 44px;
}

.telegram-access-editor-message.success-text {
  color: #08634c;
}

@media (max-width: 720px) {
  .telegram-access-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .telegram-access-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .telegram-access-count {
    width: 100%;
  }

  .telegram-id-controls {
    grid-template-columns: 1fr;
  }
}
